-
Notifications
You must be signed in to change notification settings - Fork 46
36 lines (32 loc) · 1.24 KB
/
release_notes_updated.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Release Notes Updated
on:
pull_request:
types: [opened, synchronize]
jobs:
release_notes_updated:
name: release notes updated
runs-on: ubuntu-latest
steps:
- name: Check for development branch
id: branch
shell: python
run: |
from re import compile
main = '^main$'
release = '^release_v\d+\.\d+\.\d+$'
dep_update = '^latest-dep-update-[a-f0-9]{7}$'
min_dep_update = '^min-dep-update-[a-f0-9]{7}$'
regex = main, release, dep_update, min_dep_update
patterns = list(map(compile, regex))
ref = "${{ github.event.pull_request.head.ref }}"
is_dev = not any(pattern.match(ref) for pattern in patterns)
print('::set-output name=is_dev::' + str(is_dev))
- name: Checkout repository
if: ${{ steps.branch.outputs.is_dev == 'True' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Check if release notes were updated
if: ${{ steps.branch.outputs.is_dev == 'True' }}
run: cat docs/source/release_notes.rst | grep ":pr:\`${{ github.event.number }}\`"