避免重复action
This commit is contained in:
parent
e721d3b162
commit
2d4e6cf07c
@ -1,4 +1,4 @@
|
||||
name: Create README
|
||||
name: Create README with Commit History
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -8,6 +8,7 @@ on:
|
||||
jobs:
|
||||
create-readme:
|
||||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, 'Create README with commit history')"
|
||||
|
||||
steps:
|
||||
- name: Checkout code from Gitea
|
||||
@ -45,12 +46,12 @@ jobs:
|
||||
run: |
|
||||
# 去除多余的 https://
|
||||
CLEAN_REPO_URL="${CLEAN_REPO_URL#https://}"
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git config --local user.email "liyepan@linuxacme.com"
|
||||
git config --local user.name "iorebuild"
|
||||
git add README.md
|
||||
if git diff --staged --quiet; then
|
||||
echo "No changes to commit."
|
||||
else
|
||||
git commit -m "Create README with repository name"
|
||||
git commit -m "Create README with commit history"
|
||||
git push "https://${GITEA_TOKEN}@${CLEAN_REPO_URL}"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user