Skip to content

Commit

Permalink
ci: fix cfg-grammar's PR ID query
Browse files Browse the repository at this point in the history
The owner is only needed if it's coming from a fork

Signed-off-by: Szilard Parrag <[email protected]>
  • Loading branch information
OverOrion committed Oct 3, 2024
1 parent 590335c commit 0de447f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/comment-cfg-grammar-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ jobs:
# There is also no json field in the `gh run view` command, which could give us the PR ID, so we can only query it based on the fork and branch.
# See https://github.com/orgs/community/discussions/25220
PR_ID=$(gh pr view -R "${{ github.repository }}" "${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }}" --json "number" --jq ".number")
OWNER="${{ github.event.workflow_run.head_repository.owner.login }}"
if [[ "${OWNER}" == "axoflow" ]]; then
PR_ID=$(gh pr view -R "${{ github.repository }}" "${{ github.event.workflow_run.head_branch }}" --json "number" --jq ".number")
else
PR_ID=$(gh pr view -R "${{ github.repository }}" "${OWNER}":"${{ github.event.workflow_run.head_branch }}" --json "number" --jq ".number")
echo "pr-id=${PR_ID}" >> $GITHUB_OUTPUT
- name: Update or remove PR comment
Expand Down

0 comments on commit 0de447f

Please sign in to comment.