Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid workflow being suspended #14

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/avoid.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 "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 }}
1 change: 1 addition & 0 deletions UUID.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d3e77b70-1b62-49d3-b6c3-6b7da0287258