Skip to content

Commit 4eab65b

Browse files
authored
Update update-banned.yml
1 parent fdc1032 commit 4eab65b

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

.github/workflows/update-banned.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,33 @@ on:
55
- cron: '*/30 * * * *'
66
workflow_dispatch:
77

8+
permissions:
9+
contents: write
10+
811
jobs:
912
update-banned:
1013
runs-on: self-hosted
11-
1214
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.PUSH_PAT }}
19+
path: malicious_ips
20+
1321
- name: Run update script
14-
run: |
15-
echo "Running script.sh..."
16-
bash ~/script.sh
22+
run: bash ~/script.sh
1723

1824
- name: Commit and push updated IP list
25+
working-directory: malicious_ips
1926
run: |
20-
cd ~/malicious_ips
2127
git add malicious_ips.txt
22-
28+
2329
if git diff --staged --quiet; then
2430
echo "Nothing to update."
2531
exit 0
2632
fi
27-
28-
git -c user.name='nixbear-actions' -c user.email='bot@srv.local' commit -m "Update banned IPs $(date -u +'%Y-%m-%d %H:%M:%S UTC')"
29-
30-
git remote set-url origin https://x-access-token:${{ secrets.PUSH_PAT }}@github.com/nixbear/malicious_ips.git
31-
git push origin main
32-
33+
34+
git config user.name 'nixbear-actions'
35+
git config user.email ${{ secrets.GH_EMAIL }}
36+
git commit -m "Update banned IPs $(date -u +'%Y-%m-%d %H:%M:%S UTC')"
37+
git push

0 commit comments

Comments
 (0)