From e3099012dd2598dee9fc3864a712ceaac7b6bc8f Mon Sep 17 00:00:00 2001 From: JJGadgets Date: Mon, 21 Apr 2025 17:55:13 +0800 Subject: [PATCH] feat(GHA): Renovate auto rebase after PR automerge enabled --- .github/workflows/renovate-rebase.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/renovate-rebase.yaml b/.github/workflows/renovate-rebase.yaml index a50a32ac..bd4502fa 100644 --- a/.github/workflows/renovate-rebase.yaml +++ b/.github/workflows/renovate-rebase.yaml @@ -34,11 +34,6 @@ jobs: run: | getOtherRuns () { echo "\ - $(gh run list --repo ${{ github.event.pull_request.base.repo.full_name }} --workflow=renovate-rebase.yaml --status in_progress --json headBranch --jq '.[].headBranch')\ - $(gh run list --repo ${{ github.event.pull_request.base.repo.full_name }} --workflow=renovate-rebase.yaml --status queued --json headBranch --jq '.[].headBranch')\ - $(gh run list --repo ${{ github.event.pull_request.base.repo.full_name }} --workflow=renovate-rebase.yaml --status waiting --json headBranch --jq '.[].headBranch')\ - $(gh run list --repo ${{ github.event.pull_request.base.repo.full_name }} --workflow=renovate-rebase.yaml --status requested --json headBranch --jq '.[].headBranch')\ - $(gh run list --repo ${{ github.event.pull_request.base.repo.full_name }} --workflow=renovate-rebase.yaml --status pending --json headBranch --jq '.[].headBranch')\ $(gh run list --repo ${{ github.event.pull_request.base.repo.full_name }} --workflow=kube-flux-diff.yaml --status in_progress --json headBranch --jq '.[].headBranch')\ $(gh run list --repo ${{ github.event.pull_request.base.repo.full_name }} --workflow=kube-flux-diff.yaml --status queued --json headBranch --jq '.[].headBranch')\ $(gh run list --repo ${{ github.event.pull_request.base.repo.full_name }} --workflow=kube-flux-diff.yaml --status waiting --json headBranch --jq '.[].headBranch')\ @@ -55,12 +50,12 @@ jobs: runsCount="$(getOtherRunsCount)" getOtherRuns echo "run 1 $runsCount" - if [[ "${runsCount}" == "1" ]]; then # 1 run because current + if [[ "${runsCount}" == "0" ]]; then # 1 run because current sleep 2 runsCount2="$(getOtherRunsCount)" getOtherRuns echo "run 2 $runsCount2" - if [[ "${runsCount2}" == "1" ]]; then + if [[ "${runsCount2}" == "0" ]]; then echo "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 }} break