Skip to content

Commit c265547

Browse files
Update extract.yml
1 parent 8671059 commit c265547

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

‎.github/workflows/extract.yml‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
name: Extract ZIP at Root and Commit
22

33
on:
4-
workflow_dispatch: # Manual trigger
4+
workflow_dispatch:
55

66
jobs:
77
deploy-root-zip:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
# 1️⃣ Checkout full repository
11+
# 1️⃣ Checkout repo without persisting default token
1212
- name: Checkout repository
1313
uses: actions/checkout@v3
1414
with:
1515
fetch-depth: 0
16+
persist-credentials: false # IMPORTANT: disables default GITHUB_TOKEN
1617

17-
# 2️⃣ Install unzip if not present
18+
# 2️⃣ Install unzip
1819
- name: Install unzip
1920
run: sudo apt-get update && sudo apt-get install -y unzip
2021

@@ -27,16 +28,14 @@ jobs:
2728
env:
2829
GH_PAGES_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
2930
run: |
30-
# Configure git
3131
git config user.name "github-actions[bot]"
3232
git config user.email "github-actions[bot]@users.noreply.github.com"
3333
34-
# Stage everything and remove the zip
3534
git add .
3635
git rm -f docs_build.zip
3736
3837
# Commit only if there are changes
3938
git diff-index --quiet HEAD || git commit -m "Extract docs_build.zip at root"
4039
41-
# Push using GH_PAGES_TOKEN
40+
# Push using personal token
4241
git push https://x-access-token:${GH_PAGES_TOKEN}@github.com/${GITHUB_REPOSITORY}.git main

0 commit comments

Comments
 (0)