Skip to content

Commit 7570edd

Browse files
ci: dry-run hacktoberfest prep on push/PR, add path filters
1 parent fb906d8 commit 7570edd

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/hacktoberfest_prep.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
name: hacktoberfest_prep
77

88
on:
9+
push:
10+
paths:
11+
- '.github/workflows/hacktoberfest_prep.yml'
12+
- 'scripts/hacktoberfest_prep_update.py'
13+
pull_request:
14+
paths:
15+
- '.github/workflows/hacktoberfest_prep.yml'
16+
- 'scripts/hacktoberfest_prep_update.py'
917
schedule:
1018
- cron: "50 11 * * *" # 11:50 UTC every day
1119
workflow_dispatch: # allow a manual run while testing
@@ -37,7 +45,20 @@ jobs:
3745
set +e
3846
python scripts/hacktoberfest_prep_update.py
3947
echo "exit_code=$?" >> "$GITHUB_OUTPUT"
48+
# Dry run on push / pull_request: show the diff the script produced but
49+
# do NOT commit or push. This lets a PR prove the tracker still gathers
50+
# its data and rewrites docs/hacktober_2026_prep.md correctly without
51+
# leaving a permanent commit. Only the schedule/manual runs persist.
52+
- name: Show changes (dry run)
53+
if: github.event_name == 'push' || github.event_name == 'pull_request'
54+
run: |
55+
echo "Dry run (${{ github.event_name }}): showing git diff, not committing."
56+
git --no-pager diff -- docs/hacktober_2026_prep.md
57+
if git diff --quiet -- docs/hacktober_2026_prep.md; then
58+
echo "No changes to docs/hacktober_2026_prep.md."
59+
fi
4060
- name: Commit any changes
61+
if: github.event_name != 'push' && github.event_name != 'pull_request'
4162
run: |
4263
git config --global user.name "$GITHUB_ACTOR"
4364
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"

0 commit comments

Comments
 (0)