mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
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`.
This commit is contained in:
22
.github/workflows/check-change-note.yml
vendored
22
.github/workflows/check-change-note.yml
vendored
@@ -1,9 +1,10 @@
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [labeled, unlabeled, opened, synchronize, reopened, ready_for_review]
|
||||
paths:
|
||||
- '**/*.ql'
|
||||
- '**/*.qll'
|
||||
- '!**/experimental/**'
|
||||
- "*/ql/src/**/*.ql"
|
||||
- "*/ql/src/**/*.qll"
|
||||
- "!**/experimental/**"
|
||||
|
||||
jobs:
|
||||
check-change-note:
|
||||
@@ -19,17 +20,14 @@ jobs:
|
||||
- name: Get PR labels
|
||||
id: pr-labels
|
||||
uses: joerick/pr-labels-action@v1.0.6
|
||||
- name: Inform the PR author
|
||||
- name: Fail if change note is missing
|
||||
uses: actions/github-script@v3
|
||||
if: |
|
||||
steps.paths_filter.outputs.change_note == 'false' &&
|
||||
!contains(steps.pr-labels.outputs.labels, ' minor-change ')
|
||||
github.event.pull_request.draft == false &&
|
||||
steps.paths_filter.outputs.change_note == 'false' &&
|
||||
!contains(steps.pr-labels.outputs.labels, ' no-change-note-required ')
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
github.issues.addLabels({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: ['Needs change note']
|
||||
})
|
||||
core.setFailed('No change note found.' +
|
||||
' Either add one, or add the `no-change-note-required` label.')
|
||||
|
||||
Reference in New Issue
Block a user