diff --git a/.gitea/workflows/AutoGenerateREADME.yaml b/.gitea/workflows/AutoGenerateREADME.yaml index 9cbd5ee..aaf06d4 100644 --- a/.gitea/workflows/AutoGenerateREADME.yaml +++ b/.gitea/workflows/AutoGenerateREADME.yaml @@ -30,7 +30,13 @@ jobs: cat README.md - name: Commit and push changes + env: + GITEA_TOKEN: ${{ secrets.AUTOGENERATE }} + GITEA_REPO_URL: ${{ github.server_url }}/${{ github.repository }} + CLEAN_REPO_URL: ${{ github.server_url }}/${{ github.repository }} 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 add README.md @@ -38,5 +44,5 @@ jobs: echo "No changes to commit." else git commit -m "Create README with repository name" - git push "https://AUTOGENERATE@${{ github.server_url }}/${{ github.repository }}" + git push "https://${GITEA_TOKEN}@${CLEAN_REPO_URL}" fi \ No newline at end of file