Keep Workflow Alive #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |