Skip to content

Commit

Permalink
update action
Browse files Browse the repository at this point in the history
  • Loading branch information
ruijzhan committed Oct 29, 2024
1 parent 689493d commit ef40387
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
fetch-depth: 1 # 只获取最近一次提交

- name: Set up cache
uses: actions/cache@v2
with:
path: ~/.cache
key: ${{ runner.os }}-cache-${{ hashFiles('**/makefile') }}
restore-keys: |
${{ runner.os }}-cache-
- name: Set up environment
run: |
Expand All @@ -26,5 +34,8 @@ jobs:
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git diff --quiet && git diff --staged --quiet || (git add . ; git commit -m 'Automated update')
git push
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m 'Automated update'
git push
fi

0 comments on commit ef40387

Please sign in to comment.