Skip to content

Commit

Permalink
Update version-check.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
naher94 authored Feb 13, 2024
1 parent 2858d4f commit fce117c
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,18 @@ name: Version Check

on:
pull_request:
types:
- synchronize
- opened
- reopened
- edited
paths:
- '**/*' # This triggers the workflow for any file changes

jobs:
check-version:
print-changes:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Print changed files
- name: Print Changed Files
run: |
echo "Changed files in this pull request 1:"
echo "Changed Files:"
git diff --name-only ${{ github.event.before }} ${{ github.sha }}
# 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'
else
echo "Error: '_config.yml' not modified in this pull request. Please make changes to '_config.yml' before merging."
exit 1
fi

0 comments on commit fce117c

Please sign in to comment.