Skip to content

Commit

Permalink
fix: use last_pr
Browse files Browse the repository at this point in the history
  • Loading branch information
olegsu committed Dec 14, 2021
1 parent a22fbf4 commit 0d6a26d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
gh auth login --with-token < token
go install github.com/davidrjonas/semver-cli@latest
last_pr=$(gh pr list -s merged --json number,mergedAt -q '. |= sort_by(.mergedAt) | .[-1].number')
bump=$(gh pr view --json labels --jq '.labels | map(select(.name | contains("release")) | .name) | .[0]')
bump=$(gh pr view $last_pr --json labels --jq '.labels | map(select(.name | contains("release")) | .name) | .[0]')
if ! [[ "$bump" =~ ^(release-minor|release-patch|release-major) ]]; then echo "Not a release commit" && exit 0; fi;
current=$(gh release list | awk '{print $1}' | awk 'NR==1' | sed s/v//g)
semver-cli inc $(echo $bump | sed s/release-//g) $current > next_version
Expand Down

0 comments on commit 0d6a26d

Please sign in to comment.