Skip to content

Commit

Permalink
Fix the load test comment condition (#5021)
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat authored Oct 7, 2024
1 parent b20beb1 commit 64f6201
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,20 @@ jobs:
name: k6-output
path: /tmp/k6-summary.txt

- name: Check if comment needs to be posted
# Do not post comments on forks, or when merging a PR
id: set-post-comment
run: |
if [[ "${{ github.event_name }}" == "pull_request" && \
"${{ github.event.pull_request.head.repo.owner.login }}" == "WordPress" && \
"${{ github.actor }}" != "dependabot[bot]" ]]; then
echo "post_comment=true" >> "$GITHUB_OUTPUT"
else
echo "post_comment=false" >> "$GITHUB_OUTPUT"
fi
- name: Make comment body
if: steps.set-post-comment.outputs.post_comment == 'true'
shell: python
run: |
from pathlib import Path
Expand All @@ -730,18 +743,15 @@ jobs:
""")
- uses: peter-evans/find-comment@v3
if: steps.set-post-comment.outputs.post_comment == 'true'
id: k6-summary-comment
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: Latest k6 run output

- name: Post comment summary
uses: peter-evans/create-or-update-comment@v4
# Do not comment on forks
if: |
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.owner.login == 'WordPress' &&
github.actor != 'dependabot[bot]'
if: steps.set-post-comment.outputs.post_comment == 'true'
with:
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
Expand Down

0 comments on commit 64f6201

Please sign in to comment.