Skip to content

Commit

Permalink
fix check PR for version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
gpmayorga committed Dec 20, 2024
1 parent 098da8b commit 60b400b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,27 @@ jobs:
echo "skip_bump=false" >> $GITHUB_OUTPUT
fi
- name: Check last PR labels
- name: Check PR labels
id: check_labels
if: |
steps.version_check.outputs.skip_bump != 'true' &&
github.event.review.state == 'approved'
env:
GH_TOKEN: ${{ github.token }}
run: |
LAST_PR_NUMBER=$(gh pr list --state merged --json number --jq '.[0].number')
LABELS=$(gh pr view "$LAST_PR_NUMBER" --json labels --jq '.labels[].name')
echo "::notice::PR used to check version bump: #$LAST_PR_NUMBER"
if [ "${{ github.event_name }}" == "pull_request" ]; then
PR_NUMBER=${{ github.event.pull_request.number }}
else
PR_NUMBER=$(gh pr list --state merged --json number --jq '.[0].number')
fi
LABELS=$(gh pr view "$PR_NUMBER" --json labels --jq '.labels[].name')
echo "::notice::PR used to check version bump: #$PR_NUMBER"
echo "::notice::PR labels: "[${LABELS//$'\n'/,}]""
RELEASE_TYPE=$(./.github/ci-scripts/pr-label-check.sh) || exit_code=$?
if [ "$exit_code" -ne 0 ]; then
echo "::error::PR #"$LAST_PR_NUMBER" has more than one release label"
echo "::error::PR #"$PR_NUMBER" has more than one release label"
exit $exit_code
fi
Expand Down

0 comments on commit 60b400b

Please sign in to comment.