Skip to content

Commit

Permalink
Use PR number when looking for publish commit message (#1638)
Browse files Browse the repository at this point in the history
This fixes an issue where jobs fail when built from forks which would have
an incomplete ref. This changes to use the PR number instead which should
get the details we need.

It also allows that step to fail to continue to job since it is such a specific,
special case
  • Loading branch information
jjcarstens authored Nov 14, 2024
1 parent 99de613 commit 3c167fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,13 @@ jobs:
type=ref,event=tag
- name: Check if PR publish
continue-on-error: true
if: ${{ github.event_name == 'pull_request' }}
id: pr_publish_check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
commits=$(gh pr view ${{ github.head_ref }} --json commits --jq '.commits[] | .messageHeadline + " " + .messageBody')
commits=$(gh pr view ${{ github.event.pull_request.number }} --json commits --jq '.commits[] | .messageHeadline + " " + .messageBody')
if [[ $commits =~ \[publish\] ]]; then
echo "true"
Expand Down

0 comments on commit 3c167fb

Please sign in to comment.