From 1e3c8904cb173e8baf67ffbe43cefed21dd53937 Mon Sep 17 00:00:00 2001 From: Michel Engelen <32863416+michelengelen@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:30:25 +0100 Subject: [PATCH] [infra] Fix for matrix array generation (#235) --- .github/workflows/prs_create-cherry-pick-pr.yml | 2 +- .github/workflows/scripts/prs/detectTargetBranch.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prs_create-cherry-pick-pr.yml b/.github/workflows/prs_create-cherry-pick-pr.yml index cd6cf6c..d9b01f2 100644 --- a/.github/workflows/prs_create-cherry-pick-pr.yml +++ b/.github/workflows/prs_create-cherry-pick-pr.yml @@ -44,7 +44,7 @@ jobs: if: needs.detect_cherry_pick_targets.outputs.targetBranches != '' strategy: matrix: - branch: ${{ needs.detect_cherry_pick_targets.outputs.targetBranches }} + branch: ${{ fromJSON(needs.detect_cherry_pick_targets.outputs.targetBranches) }} permissions: issues: write pull-requests: write diff --git a/.github/workflows/scripts/prs/detectTargetBranch.js b/.github/workflows/scripts/prs/detectTargetBranch.js index 4d2c35c..0e51364 100644 --- a/.github/workflows/scripts/prs/detectTargetBranch.js +++ b/.github/workflows/scripts/prs/detectTargetBranch.js @@ -37,7 +37,7 @@ module.exports = async ({ core, context, github }) => { if (vBranchRegex.test(pr.head_ref)) { // the branch this is coming from is a version branch, so the cherry-pick target should be master core.info('>>> Head Ref is a version branch, setting `master` as target'); - core.setOutput('TARGET_BRANCHES', 'master'); + core.setOutput('TARGET_BRANCHES', ['master']); return; } @@ -61,7 +61,7 @@ module.exports = async ({ core, context, github }) => { }); // set the target branches as output to be used as an input for the next step - core.setOutput('TARGET_BRANCHES', targetLabels.join(',')); + core.setOutput('TARGET_BRANCHES', targetLabels); core.setOutput('LABELS', ['cherry-pick', ...otherLabels].join(',')); core.setOutput('REVIEWERS', reviewers.join(',')); } catch (error) {