-
Notifications
You must be signed in to change notification settings - Fork 54
32 lines (27 loc) · 942 Bytes
/
avoid.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: 'Avoid workflow being suspended'
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 "[email protected]"
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/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}