Skip to content

Commit

Permalink
Merge pull request #109 from Hau-Hau/7-release-workflow
Browse files Browse the repository at this point in the history
add error messages, simplify result
  • Loading branch information
Hau-Hau authored Sep 22, 2024
2 parents ac0082e + d59dc36 commit d9aab8e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions .github/actions/has-changes-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,15 @@ runs:
run: |
hash_current_main=$(git rev-parse origin/main)
if [ -z "$hash_current_main" ]; then
echo "result=false" >> $GITHUB_OUTPUT
exit 0
echo "Cannot fetch hash of origin/main"
exit 1
fi
hash_of_last_release=$(git tag -l "${{ inputs.project }}/*" | sort -V | tail -n 1 | xargs -I {} git rev-list -n 1 {})
if [ -z "$hash_of_last_release" ]; then
echo "result=false" >> $GITHUB_OUTPUT
exit 0
echo "Cannot fetch hash of last release"
exit 1
fi
has_differences=$(git diff --quiet "$hash_current_main:./${{ inputs.project }}" "$hash_of_last_release:./${{ inputs.project }} -- ':!*.nuspec'" && echo false || echo true)
if [ -z "$has_differences" ]; then
echo "result=false" >> $GITHUB_OUTPUT
exit 0
fi
echo "result=$has_differences" >> $GITHUB_OUTPUT

0 comments on commit d9aab8e

Please sign in to comment.