Skip to content

Commit 7a0c586

Browse files
Copilotdorkmo
andcommitted
Optimize fetch depth and restrict push to main/master branches only
Co-authored-by: dorkmo <[email protected]>
1 parent a351255 commit 7a0c586

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/html-render.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/checkout@v4
2626
with:
2727
ref: ${{ github.head_ref || github.ref_name }}
28-
fetch-depth: 0
28+
fetch-depth: 1
2929

3030
- name: Setup Node.js
3131
uses: actions/setup-node@v4
@@ -287,7 +287,7 @@ jobs:
287287
EOF
288288
289289
- name: Commit and push changes
290-
if: github.event_name != 'pull_request'
290+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
291291
run: |
292292
git config --local user.email "github-actions[bot]@users.noreply.github.com"
293293
git config --local user.name "github-actions[bot]"

0 commit comments

Comments
 (0)