-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8fc252e
commit 21d5658
Showing
1 changed file
with
33 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,33 @@ | ||
name: Check Changelog | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
check-changelog: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Check if changelog exists in PR | ||
id: check_for_changelog | ||
run: | | ||
git fetch origin ${{ github.base_ref }} --depth=1 | ||
if git diff --name-only origin/${{ github.base_ref }} | grep -q 'CHANGELOG.md'; then | ||
echo "Changelog file found." | ||
echo "changelog_exists=true" >> $GITHUB_ENV | ||
else | ||
echo "Changelog file not found." | ||
echo "changelog_exists=false" >> $GITHUB_ENV | ||
fi | ||
- name: Fail if no changelog | ||
if: env.changelog_exists == 'false' | ||
run: | | ||
echo "Error: No CHANGELOG.md file found in this Pull Request." | ||
exit 1 |