Skip to content

Commit 6d2991e

Browse files
committed
added the changes to cloudflare.yml
Signed-off-by: Kairvee Vaswani <[email protected]>
1 parent 5a8392e commit 6d2991e

File tree

1 file changed

+34
-19
lines changed

1 file changed

+34
-19
lines changed

.github/workflows/get-cloudflare.yml

+34-19
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,52 @@
1-
name: GET Cloudflare
1+
name: Fetch Cloudflare Data
22

33
on:
44
schedule:
5-
# At 6am every night
6-
- cron: '0 6 * * *'
5+
# Run at 6:00 AM UTC daily
6+
- cron: '0 6 * * *'
77

88
jobs:
9-
get-data:
10-
9+
fetch-cloudflare-data:
1110
runs-on: ubuntu-latest
1211

1312
steps:
14-
- uses: actions/checkout@v2
15-
- name: Use Node.js
16-
uses: actions/setup-node@v1
13+
- name: Checkout Repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
1718
with:
18-
node-version: '12.x'
19-
- run: npm install
20-
- name: Fetch Cloudflare data
19+
node-version: '18.x'
20+
21+
- name: Install Dependencies
22+
run: npm ci
23+
24+
- name: Fetch Cloudflare Data
2125
env:
2226
CLOUDFLARE_ZONE_TAG: ${{ secrets.CLOUDFLARE_ZONE_TAG }}
2327
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }}
2428
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
2529
run: npm run get-cloudflare
26-
- name: check for changes
27-
run: git status
28-
- name: stage changed files
30+
31+
- name: Check for Changes
32+
run: |
33+
git status
34+
if git diff --quiet; then
35+
echo "No changes detected. Exiting..."
36+
exit 0
37+
fi
38+
39+
- name: Stage and Commit Changes
2940
run: |
3041
git config --local user.name "ocf-bot"
3142
git config --local user.email "[email protected]"
3243
git add .
33-
git commit -m "🗃 Add latest cloudflare data"
34-
- name: fetch from main
35-
run: git fetch origin main
36-
- name: push code to main
37-
run: git push origin HEAD:main
44+
git commit -m "🗃 Add latest Cloudflare data"
45+
46+
- name: Fetch and Rebase Main
47+
run: |
48+
git fetch origin main
49+
git pull --rebase origin main
50+
51+
- name: Push Changes to Main
52+
run: git push origin HEAD:main

0 commit comments

Comments
 (0)