Skip to content

Commit

Permalink
Define HEAD_REF for both issue based, and PR open based cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tvami authored Feb 12, 2025
1 parent e6acfb2 commit a868e9d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/pr_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,18 @@ jobs:
fail-fast: false
steps:

- name: Get PR Info for Validation job
- name: Get PR Info for Validation Job
id: get_pr_again
run: |
PR_DATA=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.issue.number }}")
HEAD_REF=$(echo "$PR_DATA" | jq -r .head.ref)
if [[ "${{ github.event_name }}" == "issue_comment" ]]; then
PR_DATA=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.issue.number }}")
HEAD_REF=$(echo "$PR_DATA" | jq -r .head.ref)
else
HEAD_REF=${{ github.ref }}
fi
echo "HEAD_REF=$HEAD_REF" >> $GITHUB_ENV
- name: Download ldmx-sw Package
uses: actions/download-artifact@v4
Expand Down

0 comments on commit a868e9d

Please sign in to comment.