diff --git a/.github/workflows/renovate-rebase.yaml b/.github/workflows/renovate-rebase.yaml index 20257c98..8dc2aecf 100644 --- a/.github/workflows/renovate-rebase.yaml +++ b/.github/workflows/renovate-rebase.yaml @@ -7,6 +7,10 @@ on: types: ["auto_merge_enabled", "closed"] branches: ["main"] +concurrency: + cancel-in-progress: true + group: "${{ github.ref }}" + jobs: rebase-after: name: Rebase @@ -28,9 +32,12 @@ jobs: shell: bash run: | for i in $(gh pr list --repo ${{ github.event.pull_request.base.repo.full_name }} --author "tinfoild[bot]" --json title,number,autoMergeRequest,headRefName | jq '.[] | select((.autoMergeRequest != null) and (.headRefName | startswith("renovate/"))) | .number'); do - sha=$(gh pr view ${i} --json headRefOid --jq '.headRefOid' --repo ${{ github.event.pull_request.base.repo.full_name }}) - gh api --method PUT /repos/${{ github.event.pull_request.base.repo.full_name }}/pulls/${i}/update-branch --field expected_head_sha=${sha} + echo "i = ${i}" + # sha=$(gh pr view ${i} --json headRefOid --jq '.headRefOid' --repo ${{ github.event.pull_request.base.repo.full_name }}) + # echo "sha = ${sha}" + gh pr update-branch ${i} --repo ${{ github.event.pull_request.base.repo.full_name }} done + # gh api --method PUT /repos/${{ github.event.pull_request.base.repo.full_name }}/pulls/${i}/update-branch --field expected_head_sha=${sha} - name: Update branch if automerge enabled if: github.event.action == 'auto_merge_enabled' @@ -38,4 +45,5 @@ jobs: GITHUB_TOKEN: "${{ steps.oauth-token.outputs.token }}" shell: bash run: | - gh api --method PUT /repos/${{ github.event.pull_request.base.repo.full_name }}/pulls/${{ github.event.pull_request.number }}/update-branch --field expected_head_sha=${{ github.event.pull_request.head.sha }} + gh pr update-branch ${{ github.event.pull_request.number }} --repo ${{ github.event.pull_request.base.repo.full_name }} + # gh api --method PUT /repos/${{ github.event.pull_request.base.repo.full_name }}/pulls/${{ github.event.pull_request.number }}/update-branch --field expected_head_sha=${{ github.event.pull_request.head.sha }}