This repository has been archived by the owner on Sep 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
48 lines (39 loc) · 1.5 KB
/
pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
on:
pull_request:
types: [labeled]
name: Commands
jobs:
urlchecks:
if: contains(github.event.pull_request.labels.*.name, 'needs-url-checks')
name: check-urls
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: list files
run: |
PR=$(jq --raw-output .pull_request.number "${GITHUB_EVENT_PATH}")
echo "::set-env name=PR::$PR"
files=$(curl --request GET \
--url https://api.github.com/repos/${{ github.repository }}/pulls/$PR/files \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'Accept: application/vnd.github.antiope-preview+json' \
--header 'content-type: application/json' | jq --raw-output .[].filename | sed 's/^\|$/"/g'|paste -sd, - | tr -d \" | tr -d \')
echo "::set-env name=files::$files"
- name: URLs-checker
uses: urlstechie/[email protected]
with:
save: "urls.csv"
include_files: ${{ env.files }}
print_all: true
- name: Archive URL checking results
if: failure()
uses: actions/upload-artifact@v2-preview
with:
name: urlchecker-results
path: urls.csv
- name: Delete label
if: always()
run: |
curl --request DELETE \
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ env.PR }}/labels/needs-url-checks \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \