From 08120d6a24c8e8d6be4ea732e0373ee2f8aaddf3 Mon Sep 17 00:00:00 2001 From: windmgc Date: Sat, 20 Feb 2021 12:40:04 +0800 Subject: [PATCH] Update workflow --- .github/workflows/chnroute.yml | 10 +++++++++- Makefile | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chnroute.yml b/.github/workflows/chnroute.yml index a9b8fd4..75734aa 100644 --- a/.github/workflows/chnroute.yml +++ b/.github/workflows/chnroute.yml @@ -1,5 +1,8 @@ name: chnroute +env: + GITHUB_TOKEN: ${{ secrets.ACC_TOKEN }} + on: workflow_dispatch: schedule: @@ -12,4 +15,9 @@ jobs: - uses: actions/checkout@v2 - run: | make sync - make update_repo + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git remote set-url origin https://x-access-token:${{ GITHUB_TOKEN }}@github.com/${{ github.repository }} + git add . + git commit -m "Auto update $(date -u '+%Y-%m-%d %H:%M:%S')" + git push diff --git a/Makefile b/Makefile index 204c735..5790359 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ generate_chnroutes: src/chnroutes.py update_repo: + git pull origin master git add . git diff-index --quiet HEAD || git commit -m "Auto updated $(TIME_NOW)" git push origin master