diff --git a/.github/workflows/pr_validation.yml b/.github/workflows/pr_validation.yml index 88ff45812..4bb8ec24a 100644 --- a/.github/workflows/pr_validation.yml +++ b/.github/workflows/pr_validation.yml @@ -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