Add keep-alive workflow for scheduled actions#460
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow intended to keep scheduled workflows from being disabled due to repository inactivity by creating a small periodic commit.
Changes:
- Introduces a monthly scheduled workflow (plus manual trigger) to write a UTC timestamp to
.github/.keepalive - Commits and pushes the updated timestamp back to the repository using
GITHUB_TOKEN
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - uses: actions/checkout@v4 | ||
|
|
There was a problem hiding this comment.
workflow_dispatch can be run on any branch; with the current actions/checkout default, this will commit the keepalive file to whatever branch the user selected, which may not reset the inactivity clock for the repository’s default branch. Consider explicitly checking out and pushing to ${{ github.event.repository.default_branch }} (or github.ref_name guarded to the default branch) so keepalive commits consistently land on the intended branch.
| # Run on the 1st of every month at midnight UTC | ||
| - cron: '0 0 1 * *' | ||
| workflow_dispatch: | ||
|
|
There was a problem hiding this comment.
There’s no workflow/job concurrency set; if a manual dispatch overlaps with the scheduled run (or a rerun), both jobs can try to commit/push and cause a non-fast-forward push failure. Add a concurrency group (and optionally cancel-in-progress: true) to ensure only one keepalive run can push at a time.
| concurrency: | |
| group: keepalive-${{ github.ref }} | |
| cancel-in-progress: true |
Summary
.github/.keepaliveHow it works
GitHub deprioritizes and eventually disables scheduled workflows on repos with no recent commit activity. This workflow runs on the 1st of every month, commits a small timestamp file, and resets the inactivity clock for all workflows — including itself.
Can also be triggered manually via
workflow_dispatchif needed.Claude help with it.