Skip to content

Commit 6095138

Browse files
committed
Actions: Address comments on change note CI check
- Fail the CI check if change note is missing. - Disregards changes outside of `*/ql/src`. - Runs the workflow on label changes, and upon moving the PR out of draft mode. - Only fails the CI check if the PR is out of draft. - Changes label to `no-change-note-required`.
1 parent 03d3f2c commit 6095138

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
on:
22
pull_request_target:
3+
types: [labeled, unlabeled, opened, synchronize, reopened, ready_for_review]
34
paths:
4-
- '**/*.ql'
5-
- '**/*.qll'
6-
- '!**/experimental/**'
5+
- "*/ql/src/**/*.ql"
6+
- "*/ql/src/**/*.qll"
7+
- "!**/experimental/**"
78

89
jobs:
910
check-change-note:
@@ -19,17 +20,14 @@ jobs:
1920
- name: Get PR labels
2021
id: pr-labels
2122
uses: joerick/pr-labels-action@v1.0.6
22-
- name: Inform the PR author
23+
- name: Fail if change note is missing
2324
uses: actions/github-script@v3
2425
if: |
25-
steps.paths_filter.outputs.change_note == 'false' &&
26-
!contains(steps.pr-labels.outputs.labels, ' minor-change ')
26+
github.event.pull_request.draft == false &&
27+
steps.paths_filter.outputs.change_note == 'false' &&
28+
!contains(steps.pr-labels.outputs.labels, ' no-change-note-required ')
2729
with:
2830
github-token: ${{secrets.GITHUB_TOKEN}}
2931
script: |
30-
github.issues.addLabels({
31-
issue_number: context.issue.number,
32-
owner: context.repo.owner,
33-
repo: context.repo.repo,
34-
labels: ['Needs change note']
35-
})
32+
core.setFailed('No change note found.' +
33+
' Either add one, or add the `no-change-note-required` label.')

0 commit comments

Comments
 (0)