Skip to content

Add keep-alive workflow for scheduled actions#460

Merged
bph merged 2 commits intoWordPress:trunkfrom
bph:add-keepalive-workflow
Mar 26, 2026
Merged

Add keep-alive workflow for scheduled actions#460
bph merged 2 commits intoWordPress:trunkfrom
bph:add-keepalive-workflow

Conversation

@bph
Copy link
Copy Markdown
Collaborator

@bph bph commented Mar 26, 2026

Summary

  • Adds a monthly keep-alive workflow that writes a timestamp to .github/.keepalive
  • This prevents GitHub from silently stopping scheduled workflow runs due to repository inactivity
  • Fixes the label-notifier workflow which stopped running after no commits since December 2025

How 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_dispatch if needed.

Claude help with it.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +15 to +16
- uses: actions/checkout@v4

Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
# Run on the 1st of every month at midnight UTC
- cron: '0 0 1 * *'
workflow_dispatch:

Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
concurrency:
group: keepalive-${{ github.ref }}
cancel-in-progress: true

Copilot uses AI. Check for mistakes.
@bph bph merged commit a710b98 into WordPress:trunk Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants