updated workflow so it works correctly on the forked repo

This commit is contained in:
Viet Huynh
2023-09-08 05:41:30 +07:00
parent dd8b741bf2
commit 6cf50bddcf
+6 -15
View File
@@ -2,44 +2,37 @@ name: Update Filter Lists
on: on:
schedule: schedule:
- cron: '0 3 * * 1' - cron: "0 3 * * 1"
push: push:
branches: branches:
- '**' - main
workflow_dispatch: workflow_dispatch:
jobs: jobs:
cgps: cgps:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js - name: Install Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: lts/*
- name: Clone repository and switch to v1 branch
run: |
git clone https://github.com/mrrfv/cloudflare-gateway-pihole-scripts.git
cd cloudflare-gateway-pihole-scripts
git checkout v1
- name: Install npm dependencies - name: Install npm dependencies
run: npm ci run: npm ci
working-directory: cloudflare-gateway-pihole-scripts
- name: Download recommended whitelist - name: Download recommended whitelist
run: bash ./get_recommended_whitelist.sh run: bash ./get_recommended_whitelist.sh
working-directory: cloudflare-gateway-pihole-scripts
- name: Download recommended filters - name: Download recommended filters
run: bash ./get_recommended_filters.sh run: bash ./get_recommended_filters.sh
working-directory: cloudflare-gateway-pihole-scripts
- name: Delete old rules and lists - name: Delete old rules and lists
run: | run: |
node cf_gateway_rule_delete.js node cf_gateway_rule_delete.js
node cf_list_delete.js node cf_list_delete.js
working-directory: cloudflare-gateway-pihole-scripts
env: env:
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }} CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
CLOUDFLARE_ACCOUNT_EMAIL: ${{ secrets.CLOUDFLARE_ACCOUNT_EMAIL }} CLOUDFLARE_ACCOUNT_EMAIL: ${{ secrets.CLOUDFLARE_ACCOUNT_EMAIL }}
@@ -50,7 +43,6 @@ jobs:
run: | run: |
node cf_list_create.js node cf_list_create.js
node cf_gateway_rule_create.js node cf_gateway_rule_create.js
working-directory: cloudflare-gateway-pihole-scripts
env: env:
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }} CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
CLOUDFLARE_ACCOUNT_EMAIL: ${{ secrets.CLOUDFLARE_ACCOUNT_EMAIL }} CLOUDFLARE_ACCOUNT_EMAIL: ${{ secrets.CLOUDFLARE_ACCOUNT_EMAIL }}
@@ -59,7 +51,6 @@ jobs:
- name: Send ping request - name: Send ping request
if: env.PING_URL != '' if: env.PING_URL != ''
working-directory: cloudflare-gateway-pihole-scripts
env: env:
PING_URL: ${{ secrets.PING_URL }} PING_URL: ${{ secrets.PING_URL }}
run: | run: |