Skip to content

Commit 4680b25

Browse files
committed
Actions: Remove dependence on external actions
1 parent ca48e57 commit 4680b25

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

.github/workflows/check-change-note.yml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,14 @@ jobs:
1010
check-change-note:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Check if change note file is present
14-
uses: dorny/paths-filter@7c0f15b688b020e95e00f15c61299b022f08ca95 # v2.8.0
15-
id: paths_filter
16-
with:
17-
filters: |
18-
change_note:
19-
- '**/change-notes/*.md'
20-
- name: Get PR labels
21-
id: pr-labels
22-
uses: joerick/pr-labels-action@0a4cc4ee0ab557ec0b1ae1157fa6fa7f9f4c494b # v1.0.6
23-
- name: Fail if change note is missing
24-
uses: actions/github-script@v3
13+
- uses: actions/checkout@v2
14+
- name: Fail if no change note found. To fix, either add one, or add the `no-change-note-required` label.
2515
if: |
2616
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 ')
29-
with:
30-
github-token: ${{secrets.GITHUB_TOKEN}}
31-
script: |
32-
core.setFailed('No change note found.' +
33-
' Either add one, or add the `no-change-note-required` label.')
17+
!contains(github.event.pull_request.labels.*.name, 'no-change-note-required')
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
run: |
21+
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate |
22+
jq '.[].filename' --raw-output |
23+
grep '/change-notes/.*\.md$'

0 commit comments

Comments
 (0)