-
-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (34 loc) · 1.45 KB
/
delete.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: "Delete Subdomain"
on:
issues:
types: [opened]
jobs:
Register:
runs-on: ubuntu-latest
if: github.event.issue.title == 'Delete'
permissions:
issues: write
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
- name: Delete Subdomain
env:
EVENT_ISSUE_BODY: ${{ github.event.issue.body }}
EVENT_USER_LOGIN: ${{ github.event.issue.user.login }}
CF_TOKEN: ${{ secrets.CF_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm i cloudflare
node --no-deprecation delete > data.csv
cat data.csv
comment=$(cut -d "|" -f 2 data.csv)
reason=$(cut -d "|" -f 1 data.csv)
domain=$(cut -d "|" -f 3 data.csv)
gh issue edit https://github.com/lgbt-sh/lgbt-sh/issues/${{ github.event.issue.number }} -t "🏳️⚧️🏳️🌈 Delete $domain" --add-label "domain delete"
if [ "$reason" = "completed" ]
then
gh issue edit https://github.com/lgbt-sh/lgbt-sh/issues/${{ github.event.issue.number }} --add-label "success"
else
gh issue edit https://github.com/lgbt-sh/lgbt-sh/issues/${{ github.event.issue.number }} --add-label "failed"
fi
gh issue close https://github.com/lgbt-sh/lgbt-sh/issues/${{ github.event.issue.number }} --comment "$comment" --reason "$reason"