-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GitHub Actions workflow to check for CHANGELOG.md update
- Loading branch information
Showing
2 changed files
with
23 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
name: Check for CHANGELOG.md Update | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
check-changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
check-changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get the list of modified files | ||
id: changed-files | ||
run: | | ||
git fetch origin ${{ github.base_ref }} --depth=1 | ||
git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }} > changed_files.txt | ||
cat changed_files.txt | ||
- name: Get the list of modified files | ||
id: changed-files | ||
run: | | ||
git fetch origin ${{ github.base_ref }} --depth=1 | ||
git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }} > changed_files.txt | ||
cat changed_files.txt | ||
- name: Check if CHANGELOG.md was updated | ||
run: | | ||
if ! grep -q "^CHANGELOG.md$" changed_files.txt; then | ||
echo "::error::CHANGELOG.md was not updated!" | ||
exit 1 | ||
else | ||
echo "CHANGELOG.md has been updated." | ||
fi | ||
- name: Check if CHANGELOG.md was updated | ||
run: | | ||
if ! grep -q "^CHANGELOG.md$" changed_files.txt; then | ||
echo "::error::CHANGELOG.md was not updated!" | ||
exit 1 | ||
else | ||
echo "CHANGELOG.md has been updated." | ||
fi |
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