Automatically prevent your scheduled GitHub Actions from becoming disabled after 60 days.
This package is meant to be deployed in an AWS environment.
It contains a Lambda function which will run every 20 days
.
The Lambda function gets GitHub repositories belonging to an organization and hits the enable workflow REST endpoint to re-enable the GitHub Actions workflow of each repository.
Additionally, you can re-enable workflows for a repository outside of your organization by modifying the src/repos.config
file with a list of GitHub_Organization/Repository_Name
entries.
- SAM CLI - Install the SAM CLI
- Python 3 installed
- Docker - Install Docker community edition
You will need a personal access token with a workflow
scope.
You will then need to store your PAT in AWS SecretsManager.
To do so, replace <foobar>
in the following command with the PAT you created above:
aws secretsmanager create-secret --name KeepActionsAlivePAT --secret-string '{"PAT": "<foobar>"}'
Copy the ARN of the created secret as you will need it when deploying the template next.
There are three parameters used when deploying the template:
PATSecretARN
: Enter the ARN from the secret for your PAT from the previous stepOrganization
: Name of the GitHub organization which you want to re-enable workflowsUseExternalRepos
: If you have repositories outside of your organization which you wish to re-enable, this will look in thesrc/repos.config
file for repos to enable (onlytrue/false
values allowed)
sam build --use-container
sam deploy --guided
If you decide you no longer want to use the application, simply run:
aws cloudformation delete-stack --stack-name KeepActionsAlive # Note: This needs to match what you entered in the `sam deploy` command
aws secretsmanager delete-secret --secret-id KeepActionsAlivePAT