From a10df42f05a4dbc1085f0022edc04fdd8166be02 Mon Sep 17 00:00:00 2001 From: GamerNoTitle Date: Sun, 27 Dec 2020 07:37:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Action=E4=BF=9D=E6=B4=BB?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/KeepAlive.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/KeepAlive.yml diff --git a/.github/workflows/KeepAlive.yml b/.github/workflows/KeepAlive.yml new file mode 100644 index 0000000..afa12a0 --- /dev/null +++ b/.github/workflows/KeepAlive.yml @@ -0,0 +1,32 @@ +name: 'KeepActionAlive' + +on: + workflow_dispatch: + schedule: + - cron: '0 0 1 * *' + +jobs: + auto_renew: + runs-on: ubuntu-latest + steps: + - name: 'Checkout codes' + uses: actions/checkout@v2 + + - name: 'Avoid Github Workflow being suspended' + run: echo $(cat /proc/sys/kernel/random/uuid) > UUID.txt + + - name: 'Commit Files' + id: commit + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git diff --quiet && git diff --staged --quiet || git commit -am 'avoid being suspended' + echo ::set-output name=status::success + + - name: 'GitHub Push' + if: steps.commit.output.status != 'success' + uses: ad-m/github-push-action@v0.6.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} \ No newline at end of file