Skip to content

GitHub Action - Periodically re-enable repository cron workflows

License

Notifications You must be signed in to change notification settings

silverstripe/gha-keepalive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Actions - Keepalive

GitHub Action - Periodically re-enable all repository cron workflows that would otherwise auto-disable after 60 days of no repository activity - see GitHub docs.

Usage

There are no inputs for configuring this action - just define your schedule so that it runs every 60 days or less (in the below example it is run on the first of each month).

.github/workflows/keepalive.yml

name: Keepalive

on:
  # Run on a schedule of once per month
  schedule:
    - cron: '0 0 1 * *'
  workflow_dispatch:

permissions: {}

jobs:
  keepalive:
    name: Keepalive
    # Only run the cron on the account hosting this repository, not on the accounts of forks
    # github.repository take the form of AccountName/repository-name
    # Change '<account_name>/' to match the name of the account hosting this repository
    if: (github.event_name == 'schedule' && startsWith(github.repository, '<account_name>/')) || (github.event_name != 'schedule')
    runs-on: ubuntu-latest
    permissions:
      actions: write
    steps:
      - name: Keepalive
        uses: silverstripe/gha-keepalive@v1

About

GitHub Action - Periodically re-enable repository cron workflows

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •