From 0efd3119a5377fdef0b829a81898e67b88a79572 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 6 Oct 2022 06:58:07 -0400 Subject: [PATCH] GitHub Actions - Replace keepalive-workflow with custom code --- .github/workflows/main.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fc0ffb7..c3d85c9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,8 +44,6 @@ jobs: - uses: actions/checkout@v1 - - uses: gautamkrishnar/keepalive-workflow@v1 # Keeps GitHub from pausing cron'ed actions - - name: Get Koha Version Branch Name id: koha-version uses: "bywatersolutions/github-action-koha-get-version-by-label@master" @@ -189,3 +187,19 @@ jobs: CHANGELOG.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + release: + name: Keep Alive + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check age and push commit if needed + run: | + LAST_COMMIT=$( git --no-pager log -1 --format=%ct ) + NOW=$(date +%s) + DIFF=$(($NOW-$LAST_COMMIT)) + DAYS=$(($DIFF/86400)) + git config --global user.email kyle@bywatersolutions.com + git config --global user.name "Kyle M Hall" + git commit --allow-empty -m "Automated commit from keep alive workflow" + if [ "$DAYS" -gt "50" ]; then git push; fi