Skip to content

Commit

Permalink
Fetch the base branch and diff correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
cyqsimon committed Nov 3, 2023
1 parent 66cf17a commit 5a92cfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/require-changelog-for-PRs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
PR_SUBMITTER: ${{ github.actor }}
PR_NUMBER: ${{ github.event.number }}
PR_BASE: ${{ github.base_ref }}
PR_HEAD: ${{ github.head_ref }}
steps:
- uses: actions/checkout@v4
- name: Search for added line in changelog
run: |
ADDED=$(git diff -U0 ${PR_BASE}..${PR_HEAD} -- CHANGELOG.md | grep -P '^\+[^\+].+$')
git fetch --no-tags --prune --depth=1 origin
ADDED=$(git diff -U0 "origin/${PR_BASE}" HEAD -- CHANGELOG.md | grep -P '^\+[^\+].+$')
grep "#${PR_NUMBER}\\b.*@{PR_SUBMITTER}\\b" <<< "$ADDED"

0 comments on commit 5a92cfd

Please sign in to comment.