Skip to content

Keep Workflow Alive #27

Keep Workflow Alive

Keep Workflow Alive #27

name: 'Keep Workflow Alive'
on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *'
jobs:
keep_alive:
runs-on: ubuntu-latest
steps:
- name: 'Checkout codes'
uses: actions/checkout@v2
- name: 'Create UUID'
run: echo $(cat /proc/sys/kernel/random/uuid) > UUID
- name: 'Commit Files'
id: commit
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff --quiet && git diff --staged --quiet || git commit -am 'Keep Workflow Alive'
echo ::set-output name=status::success
- name: 'GitHub Push'
if: steps.commit.output.status != 'success'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}