From 58d0a5a2a9a7208c01bbc9d52ec420b30bb84015 Mon Sep 17 00:00:00 2001 From: Celeter <48249130+Celeter@users.noreply.github.com> Date: Tue, 29 Dec 2020 16:59:21 +0800 Subject: [PATCH 1/2] update --- .github/workflows/main.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7bcc26c..682d3d8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,6 +5,10 @@ on: - cron: "0 22 * * *" # scheduled at 06:00 (UTC+8) everyday workflow_dispatch: +env: + # 是否允许从y1ndan/genshin-impact-helper同步代码 + ALLOW_MERGE: 'false' + jobs: build: runs-on: ubuntu-latest @@ -14,7 +18,6 @@ jobs: - name: Checkout master uses: actions/checkout@v2 with: - repository: y1ndan/genshin-impact-helper ref: master - name: Set up python @@ -26,3 +29,11 @@ jobs: run: | pip install -r requirements.txt echo "${{ secrets.COOKIE }}" | tr '#' "\n" | sed 's/$/&#${{ secrets.SCKEY }}/g' | xargs -I {} sh -c 'echo "{}" | python3 ./genshin.py' + - name: Merge From y1ndan/genshin-impact-helper + if: ${{ env.ALLOW_MERGE != 'false' }} + run: | + git config --global user.name github-actions + git config --global user.email github-actions@github.com + git remote add upstream https://github.com/y1ndan/genshin-impact-helper + git pull upstream master --allow-unrelated-histories + git push origin master From 138418dd8a1040d2c1f1539dc785e008ec5811ac Mon Sep 17 00:00:00 2001 From: Celeter <48249130+Celeter@users.noreply.github.com> Date: Tue, 29 Dec 2020 17:00:18 +0800 Subject: [PATCH 2/2] Update main.yml --- .github/workflows/main.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 682d3d8..463915c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,6 +20,15 @@ jobs: with: ref: master + - name: Merge From y1ndan/genshin-impact-helper + if: ${{ env.ALLOW_MERGE != 'false' }} + run: | + git config --global user.name github-actions + git config --global user.email github-actions@github.com + git remote add upstream https://github.com/y1ndan/genshin-impact-helper + git pull upstream master --allow-unrelated-histories + git push origin master + - name: Set up python uses: actions/setup-python@v2 with: @@ -29,11 +38,4 @@ jobs: run: | pip install -r requirements.txt echo "${{ secrets.COOKIE }}" | tr '#' "\n" | sed 's/$/&#${{ secrets.SCKEY }}/g' | xargs -I {} sh -c 'echo "{}" | python3 ./genshin.py' - - name: Merge From y1ndan/genshin-impact-helper - if: ${{ env.ALLOW_MERGE != 'false' }} - run: | - git config --global user.name github-actions - git config --global user.email github-actions@github.com - git remote add upstream https://github.com/y1ndan/genshin-impact-helper - git pull upstream master --allow-unrelated-histories - git push origin master +