Skip to content

Commit

Permalink
next attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
CybAtax committed Apr 20, 2024
1 parent 0e1fbdf commit ebf972e
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@ jobs:
uses: actions/checkout@v4
- name: Verify file changes
run: |
# Check if any files were changed
if git diff --name-only HEAD^ HEAD | grep -e '^(*gradle*|src)'; then
echo "files were changed"
exit 0
else
echo "No file was changed"
exit 1
# Check if any files in the "src" directory have been modified
src_files_changed=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.head_ref }} | grep '^src/')
if [ -n "$src_files_changed" ]; then
# Check if the "CHANGELOG.md" file has been modified
changelog_modified=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.head_ref }} | grep '^CHANGELOG.md$')
if [ -z "$changelog_modified" ]; then
echo "Error: Changes to 'src/' directory require an update to 'CHANGELOG.md'."
exit 1
else
echo "okeydokey"
exit 0
fi
fi

0 comments on commit ebf972e

Please sign in to comment.