forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add check for CHANGELOG.md change when changelog label applied to PR (s…
…olana-labs#33675) * Add check for CHANGELOG.md change when changelog label applied to PR * Update changelog
- Loading branch information
1 parent
59cb3b5
commit e5dfc9c
Showing
3 changed files
with
31 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,10 @@ | ||
#!/bin/bash | ||
set -uo pipefail | ||
|
||
CHANGELOG_FILE="CHANGELOG.md" | ||
echo "Checking: git diff --exit-code origin/${BASE_REF} -- ${CHANGELOG_FILE}" | ||
|
||
if git diff --exit-code "origin/${BASE_REF}" -- "${CHANGELOG_FILE}"; then | ||
>&2 echo "Error: this pull request requires an entry in $CHANGELOG_FILE, but no entry was found" | ||
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,20 @@ | ||
name: Require changelog entry | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, labeled, unlabeled] | ||
|
||
jobs: | ||
check-changelog: | ||
if: contains(github.event.pull_request.labels.*.name, 'changelog') | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Check if changes to CHANGELOG.md | ||
shell: bash | ||
env: | ||
BASE_REF: ${{ github.event.pull_request.base.ref }} | ||
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