-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github action requiring a diff to changelog.md.
- Loading branch information
1 parent
043ca69
commit ba6565d
Showing
1 changed file
with
40 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
# ------------------------------------------------------------------------------------------------------------------------------------------------ | ||
# Event `pull_request`: Compare the last commit of the main branch or last remote commit of the PR branch -> to the current commit of a PR branch. | ||
# ------------------------------------------------------------------------------------------------------------------------------------------------ | ||
changed_files: | ||
runs-on: ubuntu-latest | ||
name: Check CHANGELOG.md | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# ----------------------------------------------------------------------------------------------------------- | ||
# Example 1 | ||
# ----------------------------------------------------------------------------------------------------------- | ||
- name: changelog modified | ||
id: changelog-modified | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
files: CHANGELOG.md | ||
|
||
- name: List all changed files | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changelog-modified.outputs.all_changed_files }} | ||
run: | | ||
if [[ ${ALL_CHANGED_FILES[*]} =~ (^|[[:space:]])"CHANGELOG.md"($|[[:space:]]) ]]; | ||
then | ||
echo "CHANGELOG.md was modified."; | ||
exit 0; | ||
else | ||
echo "CHANGELOG.md was not modified."; | ||
echo "Please see CHANGELOG.md and follow the instructions to add your changes to that file." | ||
echo "In some rare scenarios, a changelog entry is not required and this CI check can be ignored." | ||
exit 1; | ||
fi |