• Stars
    star
    151
  • Rank 238,109 (Top 5 %)
  • Language
    JavaScript
  • License
    GNU General Publi...
  • Created over 2 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

GitHub action to prevent GitHub from suspending your cronjob based triggers due to repository inactivity

Keepalive Workflow npm version

GitHub action to prevent GitHub from suspending your cronjob based triggers due to repository inactivity

Why

GitHub will suspend the scheduled trigger for GitHub action workflows if there is no commit in the repository for the past 60 days. The cron based triggers won't run unless a new commit is made. It shows the message "This scheduled workflow is disabled because there hasn't been activity in this repository for at least 60 days" under the cronjob triggered action.

preview

What

This workflow will automatically create a dummy commit in your repo if the last commit in your repo is 50 days (default) ago. This will keep the cronjob trigger active so that it will run indefinitely without getting suspended by GitHub for inactivity.

How to use

There are two ways you can consume this library in your GitHub actions

Via GitHub Actions (For GitHub Actions users)

You can just include the library as a step after one of your favorite GitHub actions. Your workflow file should have the checkout action defined in one of your steps since this library needs git CLI to work.

name: Github Action with a cronjob trigger
on:
  schedule:
    - cron: "0 0 * * *"

jobs:
  cronjob-based-github-action:
    name: Cronjob based github action
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      # - step1
      # - step 2
      # - step n, use it as the last step
      - uses: gautamkrishnar/keepalive-workflow@v1 # using the workflow with default settings
Let's take an example of [Waka Readme](https://github.com/athul/waka-readme)
name: My awesome readme
on:
  workflow_dispatch:
  schedule:
    # Runs at 12 am UTC
    - cron: "0 0 * * *"

jobs:
  update-readme:
    name: Update this repo's README
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: athul/waka-readme@master
        with:
          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
      - uses: gautamkrishnar/keepalive-workflow@v1 # using the workflow with default settings

Via JavaScript library (For GitHub Actions developers)

For developers making awesome GitHub actions, you can consume the library in your javascript-based GitHub action by installing it from NPM. Make sure that your GitHub action uses checkout action since this library needs it as a dependency. You can also ask your users to include it as an additional step as mentioned in the first part.

Install the package

Install via NPM:

npm i keepalive-workflow

Install via Yarn:

yarn add keepalive-workflow

Use it in your own GitHub action source code

const core = require('@actions/core');
const { KeepAliveWorkflow } = require('keepalive-workflow');

// Using the lib
KeepAliveWorkflow(githubToken, committerUsername, committerEmail, commitMessage, timeElapsed)
  .then((message) => {
    core.info(message);
    process.exit(0);
  })
  .catch((error) => {
    core.error(error);
    process.exit(1);
  });

Options

For GitHub Action

If you use the workflow as mentioned via GitHub actions following are the options available to you to customize its behavior.

Option Default Value Description Required
gh_token your default GitHub token with repo scope GitHub access token with Repo scope No
commit_message Automated commit by Keepalive Workflow to keep the repository active Commit message used while committing to the repo No
committer_username gkr-bot Username used while committing to the repo No
committer_email [email protected] Email id used while committing to the repo No
time_elapsed 50 Time elapsed from the previous commit to trigger a new automated commit (in days) No
auto_push true Defines if the workflow pushes the changes automatically No

For Javascript Library

If you are using the JS Library version of the project, please consult the function's DocString in library.js to see the list of available parameters.

FAQs and Common issues

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Abit
Abit

πŸ’»
Guillaume NICOLAS
Guillaume NICOLAS

πŸ“–
Daniel Maticzka
Daniel Maticzka

πŸ’»
iTrooz
iTrooz

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

License

This project uses GNU GENERAL PUBLIC LICENSE

Liked it?

Hope you liked this project, don't forget to give it a star ⭐.

More Repositories

1

blog-post-workflow

Show your latest blog posts from any sources or StackOverflow activity or Youtube Videos on your GitHub profile/project readme automatically using the RSS feed
JavaScript
2,857
star
2

nothing-private

Do you think you are safe using private browsing or incognito mode?. πŸ˜„ πŸ‘Ώ This will prove that you're wrong.
JavaScript
2,001
star
3

socli

Stack overflow command line client. Search and browse stack overflow without leaving the terminal πŸ’»
Python
1,092
star
4

motrix-webextension

A browser extension for the Motrix Download Manager
JavaScript
1,069
star
5

tcso

Try Catch Stack overflow (TcSo) Is a collection of Try statements in all the programming languages under the globe which catches the exception and searches for the cause of the caught exception in the stack overflow automatically.
JavaScript
278
star
6

github-pages-gallery

A zero dollar solution to host your photo/video gallery online using Github pages and GitHub Actions. No coding necessary.
CSS
174
star
7

gautamkrishnar

Yet another GitHub profile readme πŸ˜ƒ
153
star
8

refined-github-feeds

This browser extension enables you to filter the GitHub news feeds based on different event types.
JavaScript
61
star
9

Be-Like-Bill

Be Like Bill meme generator and API created with PHP, Using this API you can include customised version of "Be like Bill" meme on your website.
PHP
55
star
10

Openbooks

An online reopository to share books. Created in the loving memory of the internet's own boy Aaron swartz, on his birthday.
HTML
49
star
11

Lychee-openshift-quickstart

OpenShift Lychee Quickstart
PHP
12
star
12

hatter

An AIML Python chat bot
Python
11
star
13

naughtychecker.js

NodeJS module to check Naughty Strings, it is a set of strings which have a high probability of causing issues when used as user-input data.
JavaScript
9
star
14

grav-openshift-quickstart

OpenShift Grav Quickstart
PHP
9
star
15

Anchor-CMS-openshift-quickstart

OpenShift Anchor CMS Quickstart
PHP
6
star
16

unijson.php

A universal PHP script to generate JSON from any MySQL database
PHP
6
star
17

Codiad-openshift-quickstart

OpenShift Codiad Web IDE Quickstart
PHP
5
star
18

homebrew-socli

Homebrew formula for the socli on macOS and linux
Ruby
3
star
19

Shell-Scripts

A collection of useful shell scripts for daily use. It will surely saves you a lots of time.
Shell
3
star
20

CodeIgniter-openshift-quickstart

OpenShift CodeIgniter Quickstart
HTML
3
star
21

ASTRA

A fully integrated workflow management system for government offices with built in queuing and complaint registration system.
JavaScript
3
star
22

profanity-finder.js

Simple profanity finding library for javascript to detect swear language.Created for nodejs.
JavaScript
3
star
23

Easy-folder-creator

Create 100s or 10000s of folders at a time. Just enter the required number of folders and the app will create it for you.
C++
2
star
24

gautamkrishnar.github.io

Personal website
HTML
2
star
25

azure-extplorer-extension

Extplorer extension for Microsoft Azure Websites
PHP
2
star
26

mac-toolkit

A set of tools to fine tune your Mac experience
Swift
1
star
27

joker

Random jokes from the best sources...
Python
1
star
28

Simple-referrer

A databaseless rerrer tracker written in javascript and php.
JavaScript
1
star
29

MSP-Resources

A repository of presentations and resources on Microsoft products for Microsoft student partners and fans
1
star
30

exobay

A self-hosted, OpenSource, Extensible API / Website performance and uptime monitoring service
HTML
1
star
31

Ensemble-16-website

Website of Ensemble 16 techno fest of Computer Science and Engg, Rajiv Gandhi Institute of Technology Kottayam
CSS
1
star
32

Christmas-Quiz

A Christmas quiz created in python
1
star
33

php-file-uploader

PHP file uploader with progress bar
PHP
1
star
34

hungrymenot

hungrymenot website
PHP
1
star
35

IEEE-Zeus-2.0

Source code of IEEE Zeus 2.0 website, Zeus is the signature event of IEEE RIT SB.
CSS
1
star
36

IEEE-Zeus-1.0

Source code of IEEE Zeus 1.0 website, Zeus is the signature event of IEEE RIT SB.
CSS
1
star
37

enquesta

Website of Enquesta 16, National level quiz competition held at Rajiv gandhi institute of technology Kottayam.
CSS
1
star
38

mozillakerala

Mozilla Kerala App
JavaScript
1
star
39

openshift-quickstart

One click quickstart to make your website online in Redhat's openshift cloud without typing a single command
PHP
1
star