Skip to content

Commit

Permalink
Merge pull request #640 from naher94/version-check-action
Browse files Browse the repository at this point in the history
Update version-check.yml
  • Loading branch information
naher94 authored Feb 13, 2024
2 parents 5c63135 + 28d154a commit 844d7c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,20 @@ jobs:
run: |
# Check if 'config.yml' was modified in this pull request
if git diff --name-only $DEFAULT_BRANCH HEAD | grep -q 'config.yml'; then
# Print the changes in 'config.yml' for debugging
git diff $DEFAULT_BRANCH HEAD 'config.yml'
# Check if the version was incremented
if git diff $DEFAULT_BRANCH HEAD 'config.yml' | grep -E '^\+[[:space:]]+version:[[:space:]]+[0-9]+\.[0-9]+\.[0-9]+'; then
echo "Version incremented. Check passed."
else
echo "Error: Version in 'config.yml' was not incremented. Please update the version before merging."
exit 1 # This line triggers a failure by exiting with a non-zero code
exit 1
fi
else
echo "Error: config.yml not modified in this pull request. Please make changes to config.yml before merging."
exit 1 # This line triggers a failure by exiting with a non-zero code
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 844d7c8

Please sign in to comment.