Skip to content

Daily Make and Commit #497

Daily Make and Commit

Daily Make and Commit #497

Workflow file for this run

name: Daily Make and Commit
on:
schedule:
- cron: '0 21 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1 # 只获取最近一次提交
- name: Set up cache
uses: actions/cache@v2
with:
path: |
~/.cache
~/.local
key: ${{ runner.os }}-cache-${{ hashFiles('**/makefile') }}
restore-keys: |
${{ runner.os }}-cache-
- name: Set up environment
run: |
sudo apt-get update && sudo apt-get install -y make
- name: Run make
run: make
- name: Commit and push if it changed
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m 'Automated update'
git push
fi