-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (38 loc) · 1.41 KB
/
sync-upstream.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
name: Sync Upstream
on:
#push:
# branches:
# - main
#schedule:
# - cron: "10 * * * *" # Execute at 10 minutes past the hour.
workflow_dispatch: # allow manually trigger the action
jobs:
build:
runs-on: ubuntu-latest
permissions: # Job-level permissions configuration starts here
contents: write # 'write' access to repository contents
pull-requests: write # 'write' access to pull requests
env:
GOOGLE_APPLICATION_CREDENTIALS_BASE64: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_BASE64 }}
MYSTEN_SPREEDSHEET_ID: ${{ secrets.MYSTEN_SPREEDSHEET_ID }}
BLOCKLISTS_URL: ${{ secrets.BLOCKLISTS_URL }}
READ_ACCESS_TOKEN: ${{ secrets.READ_ACCESS_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v3 # Use the GitHub checkout action to checkout code
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Install dependencies using PNPM
run: pnpm install
- name: Run script
run: pnpm sync-upstream # Execute your Node.js script
- name: Copy blocklists to src
run: cp -rf blocklists/*.json src/
- name: Commit changes
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "[email protected]"
git add .
git commit -m "Auto-update from script" || echo "No changes to commit"
git push