Skip to content

Commit

Permalink
Add check for release notes (#2569)
Browse files Browse the repository at this point in the history
Co-authored-by: Isaac Virshup <ivirshup@gmail.com>
  • Loading branch information
flying-sheep and ivirshup committed Oct 19, 2023
1 parent 0090bb9 commit 82fc260
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
Thanks for opening a PR to scanpy!
Please be sure to follow the guidelines in our contribution guide (https://scanpy.readthedocs.io/en/latest/dev/index.html) to familiarize yourself with our workflow and speed up review.
-->

<!-- Please check (“- [x]”) and fill in the following boxes -->
- [ ] Closes #
- [ ] Tests included or not required because:
<!-- Only check the following box if you did not include release notes -->
- [ ] Release notes not necessary because:
38 changes: 33 additions & 5 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/action-regex-match@v1.0.0
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 }}

0 comments on commit 82fc260

Please sign in to comment.