-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4949 from Serene-Arc/changelog_workflow
- Loading branch information
Showing
2 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Verify changelog updated | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- ready_for_review | ||
|
||
|
||
jobs: | ||
check_changes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get changed files | ||
id: getfile | ||
run: | | ||
echo "Files changed:" | ||
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}) | ||
echo "$CHANGED_FILES" | ||
echo "CHANGED_FILES<<EOF" >> $GITHUB_ENV | ||
echo "$CHANGED_FILES" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Comment PR | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
message: 'Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.' | ||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | ||
if: contains(env.CHANGED_FILES, '.py') && !contains(env.CHANGED_FILES, 'changelog.rst') |