From 265cc90ee7de5669183ab5e6de6f9075bde78b00 Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Fri, 7 Aug 2026 12:23:39 +0530 Subject: [PATCH 1/7] Add auto cherry-pick and gatekeeper workflow callers - auto-backport.yml: triggers cherry-pick engine on PR merge with 'cherry-pick to ' label - gatekeeper.yml: enforces cross-repo review sync before merge on develop, release, and support branches --- .github/workflows/auto-backport.yml | 15 +++++++++++++++ .github/workflows/gatekeeper.yml | 23 +++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/auto-backport.yml create mode 100644 .github/workflows/gatekeeper.yml diff --git a/.github/workflows/auto-backport.yml b/.github/workflows/auto-backport.yml new file mode 100644 index 0000000..cd1368a --- /dev/null +++ b/.github/workflows/auto-backport.yml @@ -0,0 +1,15 @@ +name: Automated Cherry-Pick Engine + +on: + pull_request: + types: [labeled, closed] + +jobs: + cherry-pick: + if: github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ') + uses: rdkcentral/build_tools_workflows/.github/workflows/cherry-pick.yml@develop + with: + raw_labels: ${{ toJSON(github.event.pull_request.labels) }} + trigger_label: ${{ github.event.label.name }} + secrets: + CROSS_REPO_TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} diff --git a/.github/workflows/gatekeeper.yml b/.github/workflows/gatekeeper.yml new file mode 100644 index 0000000..aa11ede --- /dev/null +++ b/.github/workflows/gatekeeper.yml @@ -0,0 +1,23 @@ +name: Topic Gatekeeper + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: + - develop + - 'release/**' + - 'support/**' + pull_request_review: + types: [submitted] + +jobs: + run-shared-gatekeeper: + if: | + github.event_name == 'pull_request' || + (github.event_name == 'pull_request_review' && + (github.event.pull_request.base.ref == 'develop' || + startsWith(github.event.pull_request.base.ref, 'release/') || + startsWith(github.event.pull_request.base.ref, 'support/'))) + uses: rdkcentral/build_tools_workflows/.github/workflows/gatekeeper.yml@develop + secrets: + CROSS_REPO_TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} From 68e60d77a5d4900eef75f69ad65e55d55773fa0f Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Fri, 7 Aug 2026 13:44:35 +0530 Subject: [PATCH 2/7] Support cherry-pick label on already-merged PRs via issues:labeled trigger --- .github/workflows/auto-backport.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-backport.yml b/.github/workflows/auto-backport.yml index cd1368a..d607b35 100644 --- a/.github/workflows/auto-backport.yml +++ b/.github/workflows/auto-backport.yml @@ -3,13 +3,22 @@ name: Automated Cherry-Pick Engine on: pull_request: types: [labeled, closed] + issues: + types: [labeled] jobs: cherry-pick: - if: github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ') + if: | + (github.event_name == 'pull_request' && + github.event.pull_request.merged == true && + contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ')) || + (github.event_name == 'issues' && + github.event.issue.pull_request.url != '' && + contains(toJSON(github.event.issue.labels.*.name), 'cherry-pick to ')) uses: rdkcentral/build_tools_workflows/.github/workflows/cherry-pick.yml@develop with: - raw_labels: ${{ toJSON(github.event.pull_request.labels) }} + raw_labels: ${{ github.event_name == 'issues' && toJSON(github.event.issue.labels) || toJSON(github.event.pull_request.labels) }} trigger_label: ${{ github.event.label.name }} + pr_number_override: ${{ github.event_name == 'issues' && github.event.issue.number || '' }} secrets: CROSS_REPO_TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} From 376b1d23aa43e79cc5243dc2a8266e96f93b4e21 Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Fri, 7 Aug 2026 14:27:24 +0530 Subject: [PATCH 3/7] Replace issues:labeled with workflow_dispatch for already-merged PR cherry-picks issues:labeled does not fire for pull requests in GitHub Actions (only for issues). workflow_dispatch lets users manually trigger cherry-pick from Actions tab for any already-merged PR by entering the PR number and target branch. --- .github/workflows/auto-backport.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/auto-backport.yml b/.github/workflows/auto-backport.yml index d607b35..0a2cd20 100644 --- a/.github/workflows/auto-backport.yml +++ b/.github/workflows/auto-backport.yml @@ -3,8 +3,16 @@ name: Automated Cherry-Pick Engine on: pull_request: types: [labeled, closed] - issues: - types: [labeled] + workflow_dispatch: + inputs: + pr_number: + description: 'Already-merged PR number to cherry-pick' + required: true + type: string + target_branch: + description: 'Target branch to cherry-pick to (e.g. support/stable2)' + required: true + type: string jobs: cherry-pick: @@ -12,13 +20,11 @@ jobs: (github.event_name == 'pull_request' && github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ')) || - (github.event_name == 'issues' && - github.event.issue.pull_request.url != '' && - contains(toJSON(github.event.issue.labels.*.name), 'cherry-pick to ')) + github.event_name == 'workflow_dispatch' uses: rdkcentral/build_tools_workflows/.github/workflows/cherry-pick.yml@develop with: - raw_labels: ${{ github.event_name == 'issues' && toJSON(github.event.issue.labels) || toJSON(github.event.pull_request.labels) }} - trigger_label: ${{ github.event.label.name }} - pr_number_override: ${{ github.event_name == 'issues' && github.event.issue.number || '' }} + raw_labels: ${{ github.event_name == 'workflow_dispatch' && format('[{{"name":"cherry-pick to {0}"}}]', inputs.target_branch) || toJSON(github.event.pull_request.labels) }} + trigger_label: ${{ github.event_name == 'workflow_dispatch' && format('cherry-pick to {0}', inputs.target_branch) || github.event.label.name }} + pr_number_override: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number || '' }} secrets: CROSS_REPO_TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} From 2026ed5ab9b3595f38e33e295da4386330101bf4 Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Fri, 7 Aug 2026 14:38:01 +0530 Subject: [PATCH 4/7] =?UTF-8?q?Revert=20to=20simple=20pull=5Frequest=20tri?= =?UTF-8?q?gger=20=E2=80=94=20labeled=20fires=20for=20merged=20PRs=20too?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-backport.yml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/auto-backport.yml b/.github/workflows/auto-backport.yml index 0a2cd20..cd1368a 100644 --- a/.github/workflows/auto-backport.yml +++ b/.github/workflows/auto-backport.yml @@ -3,28 +3,13 @@ name: Automated Cherry-Pick Engine on: pull_request: types: [labeled, closed] - workflow_dispatch: - inputs: - pr_number: - description: 'Already-merged PR number to cherry-pick' - required: true - type: string - target_branch: - description: 'Target branch to cherry-pick to (e.g. support/stable2)' - required: true - type: string jobs: cherry-pick: - if: | - (github.event_name == 'pull_request' && - github.event.pull_request.merged == true && - contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ')) || - github.event_name == 'workflow_dispatch' + if: github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ') uses: rdkcentral/build_tools_workflows/.github/workflows/cherry-pick.yml@develop with: - raw_labels: ${{ github.event_name == 'workflow_dispatch' && format('[{{"name":"cherry-pick to {0}"}}]', inputs.target_branch) || toJSON(github.event.pull_request.labels) }} - trigger_label: ${{ github.event_name == 'workflow_dispatch' && format('cherry-pick to {0}', inputs.target_branch) || github.event.label.name }} - pr_number_override: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number || '' }} + raw_labels: ${{ toJSON(github.event.pull_request.labels) }} + trigger_label: ${{ github.event.label.name }} secrets: CROSS_REPO_TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} From 21ff4f07e6afbbfb2f612b5663acb58c5bb3b0f1 Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Fri, 7 Aug 2026 14:49:36 +0530 Subject: [PATCH 5/7] Add workflow_dispatch trigger for cherry-picking already-merged PRs pull_request:labeled only fires for OPEN PRs, not merged ones. workflow_dispatch lets users manually trigger from Actions tab: enter PR number + target branch to cherry-pick any past merged PR. --- .github/workflows/auto-backport.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-backport.yml b/.github/workflows/auto-backport.yml index cd1368a..7fe35f2 100644 --- a/.github/workflows/auto-backport.yml +++ b/.github/workflows/auto-backport.yml @@ -3,13 +3,28 @@ name: Automated Cherry-Pick Engine on: pull_request: types: [labeled, closed] + workflow_dispatch: + inputs: + pr_number: + description: 'Already-merged PR number to cherry-pick' + required: true + type: string + target_branch: + description: 'Target branch (e.g. support/stable2)' + required: true + type: string jobs: cherry-pick: - if: github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ') + if: | + (github.event_name == 'pull_request' && + github.event.pull_request.merged == true && + contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ')) || + github.event_name == 'workflow_dispatch' uses: rdkcentral/build_tools_workflows/.github/workflows/cherry-pick.yml@develop with: - raw_labels: ${{ toJSON(github.event.pull_request.labels) }} - trigger_label: ${{ github.event.label.name }} + raw_labels: ${{ github.event_name == 'workflow_dispatch' && format('[{{"name":"cherry-pick to {0}"}}]', inputs.target_branch) || toJSON(github.event.pull_request.labels) }} + trigger_label: ${{ github.event_name == 'workflow_dispatch' && format('cherry-pick to {0}', inputs.target_branch) || github.event.label.name }} + pr_number_override: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number || '' }} secrets: CROSS_REPO_TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} From 759b0c31575fdebd24414910dfb164188f25c619 Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Fri, 7 Aug 2026 15:12:53 +0530 Subject: [PATCH 6/7] Fix: use single-line if to match working fork pattern exactly --- .github/workflows/auto-backport.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/auto-backport.yml b/.github/workflows/auto-backport.yml index 7fe35f2..292bc66 100644 --- a/.github/workflows/auto-backport.yml +++ b/.github/workflows/auto-backport.yml @@ -16,11 +16,7 @@ on: jobs: cherry-pick: - if: | - (github.event_name == 'pull_request' && - github.event.pull_request.merged == true && - contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ')) || - github.event_name == 'workflow_dispatch' + if: (github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ')) || github.event_name == 'workflow_dispatch' uses: rdkcentral/build_tools_workflows/.github/workflows/cherry-pick.yml@develop with: raw_labels: ${{ github.event_name == 'workflow_dispatch' && format('[{{"name":"cherry-pick to {0}"}}]', inputs.target_branch) || toJSON(github.event.pull_request.labels) }} From 5ec7f785b193f6789d65f15d666b642b6f25a42c Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Fri, 7 Aug 2026 15:36:44 +0530 Subject: [PATCH 7/7] Simplify auto-backport: use exact working fork pattern (pull_request trigger only) --- .github/workflows/auto-backport.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/auto-backport.yml b/.github/workflows/auto-backport.yml index 292bc66..cd1368a 100644 --- a/.github/workflows/auto-backport.yml +++ b/.github/workflows/auto-backport.yml @@ -3,24 +3,13 @@ name: Automated Cherry-Pick Engine on: pull_request: types: [labeled, closed] - workflow_dispatch: - inputs: - pr_number: - description: 'Already-merged PR number to cherry-pick' - required: true - type: string - target_branch: - description: 'Target branch (e.g. support/stable2)' - required: true - type: string jobs: cherry-pick: - if: (github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ')) || github.event_name == 'workflow_dispatch' + if: github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ') uses: rdkcentral/build_tools_workflows/.github/workflows/cherry-pick.yml@develop with: - raw_labels: ${{ github.event_name == 'workflow_dispatch' && format('[{{"name":"cherry-pick to {0}"}}]', inputs.target_branch) || toJSON(github.event.pull_request.labels) }} - trigger_label: ${{ github.event_name == 'workflow_dispatch' && format('cherry-pick to {0}', inputs.target_branch) || github.event.label.name }} - pr_number_override: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number || '' }} + raw_labels: ${{ toJSON(github.event.pull_request.labels) }} + trigger_label: ${{ github.event.label.name }} secrets: CROSS_REPO_TOKEN: ${{ secrets.CROSS_REPO_TOKEN }}