Conversation
There was a problem hiding this comment.
Pull request overview
Splits the “resources badge update” logic out of the existing link-check workflow into its own dedicated GitHub Actions workflow.
Changes:
- Removed the badge update step (and related permissions/triggers) from
link-check.yml. - Added a new
badge-update.ymlworkflow to update and commitbadge/resources.jsonon pushes tomain(and manual dispatch).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/link-check.yml | Keeps link checking focused on PRs/schedule by removing badge-update responsibilities and related triggers/permissions. |
| .github/workflows/badge-update.yml | New workflow that recalculates and commits the resources badge JSON on main updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Update resources badge | ||
| run: | | ||
| git fetch origin "$GITHUB_REF_NAME" | ||
| git reset --hard "origin/$GITHUB_REF_NAME" |
There was a problem hiding this comment.
git reset --hard "origin/$GITHUB_REF_NAME" assumes $GITHUB_REF_NAME is a remote branch name. For workflow_dispatch runs started from a tag/commit, origin/<name> may not exist and this will fail. Consider resetting to FETCH_HEAD after the git fetch, or explicitly checking out a branch ref (and/or gating to github.ref_type == 'branch').
| git reset --hard "origin/$GITHUB_REF_NAME" | |
| git reset --hard FETCH_HEAD |
| git add badge/resources.json | ||
| git commit -m "chore: update resources badge" | ||
| git push origin "HEAD:$GITHUB_REF_NAME" |
There was a problem hiding this comment.
The workflow pushes back to the same branch without rebasing/handling races. If main advances while this job runs, git push can fail and the badge won’t update. Consider adding a git pull --rebase (or a retry using --force-with-lease) before pushing, and/or setting concurrency per-branch to avoid overlapping badge-update runs.
No description provided.