Actions: Remove dependence on external actions

This commit is contained in:
Taus Brock-Nannestad
2021-02-21 15:14:33 +01:00
parent ca48e57e30
commit 4680b25f23

View File

@@ -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$'