Skip to content

Commit

Permalink
Merge pull request #322 from axoflow/fix-comment-cfg-grammar-changes-…
Browse files Browse the repository at this point in the history
…pr-query

fix comment cfg grammar changes pr query
  • Loading branch information
MrAnno authored Oct 4, 2024
2 parents 1f73b5a + 82d6631 commit 8d8eab0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 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,13 @@ 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")
if [[ "${{ github.event.workflow_run.head_repository.url }}" == "${{ github.event.workflow_run.repository.url }}" ]]; then
PR_ID=$(gh pr view -R "${{ github.repository }}" "${{ github.event.workflow_run.head_branch }}" --json "number" --jq ".number")
else
# PR is from a fork
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")
fi
echo "pr-id=${PR_ID}" >> $GITHUB_OUTPUT
- name: Update or remove PR comment
Expand Down

0 comments on commit 8d8eab0

Please sign in to comment.