From 841a567a361f7808e87da59c20116585423edbeb Mon Sep 17 00:00:00 2001 From: "Matt.Wang" Date: Mon, 13 Sep 2021 16:46:42 +0800 Subject: [PATCH] fix(action): allow merging cpython on existing branch --- .github/workflows/py39-sync-cpython.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/py39-sync-cpython.yml b/.github/workflows/py39-sync-cpython.yml index 13b4214b61..d2a159d180 100644 --- a/.github/workflows/py39-sync-cpython.yml +++ b/.github/workflows/py39-sync-cpython.yml @@ -12,11 +12,18 @@ jobs: runs-on: ubuntu-latest env: VERSION: "3.9" + BRANCH: "cron/sync/3.9" steps: - uses: actions/checkout@v2 with: ref: ${{ env.VERSION }} + - name: Get the changes on branch (if exists) + continue-on-error: true + run: | + git fetch origin ${{ env.BRANCH }}:${{ env.BRANCH }} + git reset --hard ${{ env.BRANCH }} + - name: Set env run: echo "LATEST_COMMIT_ID=$(git ls-remote https://github.com/python/CPython.git $VERSION | head -c 8)" >> $GITHUB_ENV @@ -41,8 +48,8 @@ jobs: committer: GitHub author: github-actions[bot] base: ${{ env.VERSION }} - branch: cron/sync/${{ env.VERSION }} - delete-branch: true + branch: ${{ env.BRANCH }} + delete-branch: false title: 'Sync with CPython ${{ env.VERSION }}' body: | Sync with CPython ${{ env.VERSION }}