-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport PR #2569: Add check for release notes
- Loading branch information
1 parent
d48bce8
commit ddb5820
Showing
2 changed files
with
39 additions
and
5 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
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 |
---|---|---|
|
@@ -19,13 +19,41 @@ on: | |
# code change (e.g. this workflow) | ||
- synchronize | ||
|
||
env: | ||
LABELS: ${{ join( github.event.pull_request.labels.*.name, '|' ) }} | ||
|
||
jobs: | ||
# This job verifies that the milestone is present or not necessary | ||
# and determines if “check-relnotes” needs to be run. | ||
check-milestone: | ||
name: Check Milestone | ||
runs-on: ubuntu-latest | ||
steps: | ||
- if: github.event.pull_request.milestone == null && contains( env.LABELS, 'no milestone' ) == false | ||
run: exit 1 | ||
- name: Check if milestone or “no milestone” label is present | ||
uses: flying-sheep/check@v1 | ||
with: | ||
success: ${{ github.event.pull_request.milestone != null || contains(github.event.pull_request.labels.*.name, 'no milestone') }} | ||
- name: Check if the “Release notes” checkbox is checked and filled | ||
uses: kaisugi/[email protected] | ||
id: checked-relnotes | ||
with: | ||
text: ${{ github.event.pull_request.body }} | ||
regex: '^\s*- \[x\] Release notes not necessary because:(.*)$' | ||
flags: m | ||
outputs: | ||
no-relnotes-reason: ${{ steps.checked-relnotes.outputs.group1 }} | ||
# This job verifies that the relevant release notes file has been modified. | ||
check-relnotes: | ||
name: Check for release notes | ||
runs-on: ubuntu-latest | ||
needs: check-milestone | ||
if: ${{ needs.check-milestone.outputs.no-relnotes-reason == '' && !contains(github.event.pull_request.labels.*.name, 'Development Process 🚀') }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Find out if relevant release notes are modified | ||
uses: dorny/paths-filter@v2 | ||
id: changes | ||
with: | ||
filters: | # this is intentionally a string | ||
relnotes: 'docs/release-notes/${{ github.event.pull_request.milestone.title }}.md' | ||
- name: Check if relevant release notes are modified | ||
uses: flying-sheep/check@v1 | ||
with: | ||
success: ${{ steps.changes.outputs.relnotes }} |