-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Showing
2 changed files
with
51 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,46 @@ | ||
name: Verify Core Backport Changlog | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
paths: | ||
- 'lib/**' | ||
- 'packages/**/*.php' | ||
- 'phpunit/**' | ||
jobs: | ||
check: | ||
name: Check CHANGELOG diff | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Get PR commit count' | ||
run: echo "PR_COMMIT_COUNT=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" | ||
- name: Checkout code | ||
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
fetch-depth: ${{ env.PR_COMMIT_COUNT }} | ||
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} | ||
- name: 'Fetch relevant history from origin' | ||
run: git fetch origin ${{ github.event.pull_request.base.ref }} | ||
- name: Check CHANGELOG status | ||
env: | ||
PR_NUMBER: ${{ github.event.number }} | ||
run: | | ||
changelog_path="backport-changelog.md" | ||
# Fail if the PR doesn't touch the changelog | ||
if git diff --quiet ${{ github.event.pull_request.base.sha }} HEAD -- "$changelog_path"; then | ||
echo "Please add a CORE PR LINK (in Markdown) to $changelog_path" | ||
echo "If changes are related to an existing, open PR, you may use that PR" | ||
exit 1 | ||
fi | ||
pr_link_grep_pattern="https://github\.com/WordPress/gutenberg/pull/\([0-9]\+\) for https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER}" | ||
# Confirm that the CHANGELOG has an entry for the current PR | ||
if ! grep -nq -e "${pr_link_grep_pattern}" "${changelog_path}"; then | ||
echo "Please add a CORE PR LINK to $changelog_path. Make sure it is linked in Markdown." | ||
echo "If changes are related to an existing, open PR, you may use that PR" | ||
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,5 @@ | ||
# Core Backport Changelog | ||
|
||
Any PR that makes changes to be backported should log a core PR here. | ||
|
||
## 6.6 |