-
-
Notifications
You must be signed in to change notification settings - Fork 8
43 lines (37 loc) · 1.2 KB
/
copy-to-gh-pages-branch.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
name: Copy Release Blacklist to repo
on:
workflow_dispatch:
release:
types:
- published
jobs:
copy-release-blacklist:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download the latest blacklist.txt
run: |
wget -O latest_blacklist.txt https://github.com/fabriziosalmi/blacklists/releases/latest/download/blacklist.txt
continue-on-error: true
- name: Check if the file has changed
id: check_changes
run: |
if ! cmp -s latest_blacklist.txt blacklist.txt; then
mv latest_blacklist.txt blacklist.txt
echo "File updated, copying to gh-pages"
else
echo "File not updated, no action needed"
exit 1
fi
continue-on-error: true
- name: Commit and push changes to gh-pages
if: steps.check_changes.outcome == 'success'
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add blacklist.txt
git commit -m "Update blacklist.txt"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}