mirror of
https://github.com/github/codeql.git
synced 2026-04-23 15:55:18 +02:00
Actions: Remove dependence on external actions
This commit is contained in:
28
.github/workflows/check-change-note.yml
vendored
28
.github/workflows/check-change-note.yml
vendored
@@ -10,24 +10,14 @@ 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
|
||||
- uses: actions/checkout@v2
|
||||
- name: Fail if no change note found. To fix, either add one, or add the `no-change-note-required` label.
|
||||
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.')
|
||||
!contains(github.event.pull_request.labels.*.name, 'no-change-note-required')
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate |
|
||||
jq '.[].filename' --raw-output |
|
||||
grep '/change-notes/.*\.md$'
|
||||
|
||||
Reference in New Issue
Block a user