-
Notifications
You must be signed in to change notification settings - Fork 273
40 lines (37 loc) · 1.36 KB
/
guarantee-release-notes.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
37
38
39
40
name: Guarantee release notes are provided
on:
workflow_dispatch:
push:
branches: [ main, dev, dajusto/validate-release-notes-are-provided ]
paths:
- '*'
pull_request:
branches: [ main, dev, dajusto/validate-release-notes-are-provided ]
paths:
- '.github/workflows/guarantee-release-notes.yml'
pull_request:
branches: [ main, dev, dajusto/validate-release-notes-are-provided ]
types: [labeled, unlabeled]
jobs:
build:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'does-not-need-release-note') }}
steps:
- uses: actions/checkout@v2
- name: Check for release_notes.md changes
id: check_changes
run: |
echo "Checking for changes in release_notes.md..."
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q 'release_notes.md'; then
echo "release_notes.md was modified. "
echo "MODIFIED=true" >> $GITHUB_ENV
else
echo "release_notes.md was NOT modified."
echo "MODIFIED=false" >> $GITHUB_ENV
fi
- name: Fail if release_notes.md was not modified
if: env.MODIFIED == 'false'
run: |
echo {{github.event.pull_request.labels.*.name.*.name}}
echo "Error: release_notes.md must be updated in this PR."
exit 1