mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-09-28 21:45:27 +08:00
ci: dry-run the Hacktoberfest prep tracker on push/PR (#15227)
* ci: dry-run hacktoberfest prep on push/PR, add path filters
* ci: use double quotes in path filters (prettier)
* fix: resolve tracker rows via /issues so issue rows don't 404
The tracker's 'Open issues' section lists issue numbers; querying them
against /pulls/{n} returns 404 and crashed the whole refresh. Query the
unified /issues/{n} endpoint instead, which resolves for both PRs and
issues; a row is 'merged' only when it's a PR with merged_at set.
This commit is contained in:
@@ -6,6 +6,14 @@
|
||||
name: hacktoberfest_prep
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- ".github/workflows/hacktoberfest_prep.yml"
|
||||
- "scripts/hacktoberfest_prep_update.py"
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/hacktoberfest_prep.yml"
|
||||
- "scripts/hacktoberfest_prep_update.py"
|
||||
schedule:
|
||||
- cron: "50 11 * * *" # 11:50 UTC every day
|
||||
workflow_dispatch: # allow a manual run while testing
|
||||
@@ -37,7 +45,20 @@ jobs:
|
||||
set +e
|
||||
python scripts/hacktoberfest_prep_update.py
|
||||
echo "exit_code=$?" >> "$GITHUB_OUTPUT"
|
||||
# Dry run on push / pull_request: show the diff the script produced but
|
||||
# do NOT commit or push. This lets a PR prove the tracker still gathers
|
||||
# its data and rewrites docs/hacktober_2026_prep.md correctly without
|
||||
# leaving a permanent commit. Only the schedule/manual runs persist.
|
||||
- name: Show changes (dry run)
|
||||
if: github.event_name == 'push' || github.event_name == 'pull_request'
|
||||
run: |
|
||||
echo "Dry run (${{ github.event_name }}): showing git diff, not committing."
|
||||
git --no-pager diff -- docs/hacktober_2026_prep.md
|
||||
if git diff --quiet -- docs/hacktober_2026_prep.md; then
|
||||
echo "No changes to docs/hacktober_2026_prep.md."
|
||||
fi
|
||||
- name: Commit any changes
|
||||
if: github.event_name != 'push' && github.event_name != 'pull_request'
|
||||
run: |
|
||||
git config --global user.name "$GITHUB_ACTOR"
|
||||
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||
|
||||
Reference in New Issue
Block a user