-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | | ||
|
@@ -26,5 +34,8 @@ jobs: | |
run: | | ||
git config --global user.email "[email protected]" | ||
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 |