Skip to content

Commit

Permalink
Use previous commit if no GitHub before push sha (#110)
Browse files Browse the repository at this point in the history
* Fallback to main for version check if no before sha

* Use previous commit, not origin/main
  • Loading branch information
MattIPv4 authored Jan 27, 2025
1 parent ffb58b6 commit 6658362
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
id: version
run: |
set -e -o pipefail
BEFORE_VERSION=$(git show "${{ github.event.before }}:package.json" | jq -r .version)
PREVIOUS_COMMIT=$(git rev-parse HEAD^1)
BEFORE_VERSION=$(git show "${{ github.event.created && '$PREVIOUS_COMMIT' || github.event.before }}:package.json" | jq -r .version)
AFTER_VERSION=$(git show "${{ github.event.after }}:package.json" | jq -r .version)
if [ "$BEFORE_VERSION" != "$AFTER_VERSION" ]; then
Expand Down

0 comments on commit 6658362

Please sign in to comment.