From db4dc84913be95e0bb4b346d010a4bad7cdbd360 Mon Sep 17 00:00:00 2001 From: nvdaes Date: Mon, 19 Apr 2021 20:04:33 +0200 Subject: [PATCH] Add test comment workflow --- .github/workflows/testComment.yaml | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/testComment.yaml diff --git a/.github/workflows/testComment.yaml b/.github/workflows/testComment.yaml new file mode 100644 index 00000000..cc34966a --- /dev/null +++ b/.github/workflows/testComment.yaml @@ -0,0 +1,34 @@ +name: Locust summary + +on: [ pull_request_target ] + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: PR head repo + id: head_repo_name + run: | + HEAD_REPO_NAME=$(jq -r '.pull_request.head.repo.full_name' "$GITHUB_EVENT_PATH") + echo "PR head repo: $HEAD_REPO_NAME" + echo "::set-output name=repo::$HEAD_REPO_NAME" + - name: Checkout git repo + uses: actions/checkout@v2 + with: + repository: ${{ steps.head_repo_name.outputs.repo }} + fetch-depth: 0 + - name: Generate Locust summary + uses: simiotics/locust-action@main + id: locust + with: + format: html-github + - name: Comment on PR + uses: actions/github-script@v3 + with: + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '${{ steps.locust.outputs.summary }}', + }) \ No newline at end of file