-
-
Notifications
You must be signed in to change notification settings - Fork 331
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 #2675 from carsakiller/log-changes
add: workflow to assert changelog updates
- Loading branch information
Showing
3 changed files
with
45 additions
and
1 deletion.
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,17 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
CHANGELOG_FILE="changelog.md" | ||
|
||
git fetch origin $GITHUB_BASE_REF | ||
git fetch | ||
|
||
# Check if the changelog file was modified in the PR | ||
if git diff --name-only origin/$GITHUB_BASE_REF..remotes/pull/$GITHUB_SOURCE_REF | grep -q $CHANGELOG_FILE; then | ||
echo "Thank you for updating the changelog!" | ||
exit 0 | ||
else | ||
echo "Changelog has not been updated. Please update $CHANGELOG_FILE!" | ||
exit 1 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: changelog | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches: | ||
- master | ||
|
||
jobs: | ||
check-changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up environment | ||
run: | | ||
echo "GITHUB_SOURCE_REF=${{ github.ref_name }}" >> $GITHUB_ENV | ||
echo "GITHUB_BASE_REF=${{ github.base_ref }}" >> $GITHUB_ENV | ||
- name: Check if changelog is updated | ||
run: .github/scripts/check-changelog.sh |
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