Skip to content

Commit

Permalink
try to make commenter work even when using a fork
Browse files Browse the repository at this point in the history
  • Loading branch information
avivajpeyi committed Dec 11, 2024
1 parent d68f8e7 commit c31e8ff
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/pr_artifact_url_commenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
comment:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
continue-on-error: true # THIS SHOULD BE REMOVED IN THE FUTURE
steps:
- name: Get Artifact and Pull Request Info
env:
Expand All @@ -30,22 +29,22 @@ jobs:
echo "ARTIFACT_ID=$ARTIFACT_ID" >> "$GITHUB_ENV"
PR_NUMBER=$(jq -r '.pull_requests[0].number // empty' <<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_ENV"
echo "PR_NUMBER=${PR_NUMBER:-null}" >> "$GITHUB_ENV"
HEAD_SHA=$(jq -r '.head_sha' <<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_ENV"
HEAD_SHA=$(jq -r '.head_sha // empty' <<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "HEAD_SHA=${HEAD_SHA:-null}" >> "$GITHUB_ENV"
- name: Find Comment
uses: peter-evans/find-comment@v3
id: find-comment
if: env.PR_NUMBER
if: env.PR_NUMBER != 'null'
with:
issue-number: ${{ env.PR_NUMBER }}
comment-author: 'github-actions[bot]'

- name: Update Comment
uses: peter-evans/create-or-update-comment@v3
if: env.PR_NUMBER
if: env.PR_NUMBER != 'null'
env:
JOB_PATH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ env.PREVIOUS_JOB_ID }}"
ARTIFACT_URL: "${{ github.server_url }}/${{ github.repository }}/suites/${{ env.SUITE_ID }}/artifacts/${{ env.ARTIFACT_ID }}"
Expand All @@ -65,4 +64,3 @@ jobs:
| Download | ${{ env.ARTIFACT_URL }} |
[badge]: https://img.shields.io/badge/Build_Success!-0d1117?style=for-the-badge&labelColor=3fb950&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNMjEuMDMgNS43MmEuNzUuNzUgMCAwIDEgMCAxLjA2bC0xMS41IDExLjVhLjc0Ny43NDcgMCAwIDEtMS4wNzItLjAxMmwtNS41LTUuNzVhLjc1Ljc1IDMgMSAxIDEuMDg0LTEuMDM2bDQuOTcgNS4xOTVMMTkuOTcgNS43MmEuNzUuNzUgMCAwIDEgMS4wNiAwWiI+PC9wYXRoPjwvc3ZnPg==

0 comments on commit c31e8ff

Please sign in to comment.