mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Actions: Add change note checker
Co-authored-by: Taus <tausbn@github.com>
This commit is contained in:
33
.github/workflows/check-change-note.yml
vendored
Normal file
33
.github/workflows/check-change-note.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [labeled, unlabeled, opened, synchronize, reopened, ready_for_review]
|
||||
paths:
|
||||
- "*/ql/src/**/*.ql"
|
||||
- "*/ql/src/**/*.qll"
|
||||
- "!**/experimental/**"
|
||||
|
||||
jobs:
|
||||
check-change-note:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if change note file is present
|
||||
uses: dorny/paths-filter@7c0f15b688b020e95e00f15c61299b022f08ca95 # v2.8.0
|
||||
id: paths_filter
|
||||
with:
|
||||
filters: |
|
||||
change_note:
|
||||
- '**/change-notes/*.md'
|
||||
- name: Get PR labels
|
||||
id: pr-labels
|
||||
uses: joerick/pr-labels-action@0a4cc4ee0ab557ec0b1ae1157fa6fa7f9f4c494b # v1.0.6
|
||||
- name: Fail if change note is missing
|
||||
uses: actions/github-script@v3
|
||||
if: |
|
||||
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: |
|
||||
core.setFailed('No change note found.' +
|
||||
' Either add one, or add the `no-change-note-required` label.')
|
||||
Reference in New Issue
Block a user