Skip to content

Commit

Permalink
Test new script
Browse files Browse the repository at this point in the history
  • Loading branch information
phklive committed Jul 16, 2024
1 parent 44cf789 commit 9a0a5c3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@main
with:
fetch-depth: 2 # Fetch the last 2 commits to ensure we can compare with the previous commit
fetch-depth: 0

- name: Check if CHANGELOG.md is modified
run: |
if git diff --name-only HEAD^ HEAD | grep -q '^CHANGELOG.md$'; then
# Get the list of changed files in the PR
changed_files=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}...${{ github.sha }})
# Check if CHANGELOG.md is in the list of changed files
if echo "$changed_files" | grep -q '^CHANGELOG.md$'; then
echo "CHANGELOG.md has been modified."
else
echo "::error file=CHANGELOG.md::CHANGELOG.md has not been modified."
Expand Down

0 comments on commit 9a0a5c3

Please sign in to comment.