-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (33 loc) · 1.03 KB
/
check.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
name: Check blocklist
on:
issues:
types:
- labeled
permissions:
contents: write
issues: write
jobs:
check-blocklist:
if: ${{ github.event.label.name == 'check blocklist' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Check blocklist
run: |
trap 'gh issue comment ${{ github.event.issue.number }} -b \
"An error occured while checking the blocklist."' EXIT
# Get URl of blocklist
url="$(grep 'http' <<< "${{ github.event.issue.body }}")"
bash scripts/check.sh "$url"
# Update issue title and label
title="$(mawk -F '*' '{print $2}' data/TEMPLATE.md)"
gh issue edit ${{ github.event.issue.number }} -t "$title" \
--add-label 'report generated'
# Comment results
gh issue comment ${{ github.event.issue.number }} -b \
"$(cat data/TEMPLATE.md)"
env:
GH_TOKEN: ${{ github.token }}