diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index 8775a853..3950cd3b 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -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 }}