添加Action保活脚本
This commit is contained in:
parent
96f302e641
commit
a10df42f05
32
.github/workflows/KeepAlive.yml
vendored
Normal file
32
.github/workflows/KeepAlive.yml
vendored
Normal file
|
@ -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 }}
|
Loading…
Reference in New Issue
Block a user