Skip to content

Commit

Permalink
Merge pull request #650 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 508855a + 8286586 commit dbe6dfc
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,11 @@ jobs:
echo "Changed files in this pull request:"
git diff --name-only ${{ github.event.before }} ${{ github.sha }}
# Check if '_config.yml' was modified in this pull request
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q -E '^_config\.yml$'; then
# Check if '_config.yml' is in the list of changed files
if grep -q -E '^_config\.yml$' <<< "$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})"; then
echo "Changes in '_config.yml':"
git diff ${{ github.event.before }} ${{ github.sha }} '_config.yml'
# Check if the version was incremented
if git diff ${{ github.event.before }} ${{ github.sha }} '_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
fi
else
echo "Error: '_config.yml' not modified in this pull request. Please make changes to '_config.yml' before merging."
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit dbe6dfc

Please sign in to comment.