From 8e4133c890a71f31f696b92698c1831f33147ba5 Mon Sep 17 00:00:00 2001 From: Anatolii Zhmaiev Date: Tue, 26 Nov 2024 21:07:51 +0200 Subject: [PATCH] Optimize backport.yml (#1403) Use ENV var instead of empty job with output. --- .github/workflows/backport.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index e23e0bdd1..dd1ff890e 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -3,20 +3,17 @@ on: push: branches: - main + +env: + MAINTENANCE_BRANCHES: "['5.3', '5.4', '5.5']" + jobs: - get-maintenance-branches: - runs-on: ubuntu-latest - outputs: - branches: "['5.3', '5.4', '5.5']" - steps: - - run: exit 0 backport-to-all-branch: - needs: get-maintenance-branches strategy: fail-fast: false matrix: - branch: ${{ fromJSON(needs.get-maintenance-branches.outputs.branches) }} + branch: ${{ fromJSON(env.MAINTENANCE_BRANCHES) }} uses: ./.github/workflows/backport-workflow.yml with: label-to-check-for: '["backport to all versions"]' @@ -24,11 +21,10 @@ jobs: secrets: inherit backport-to-specified-branch: - needs: get-maintenance-branches strategy: fail-fast: false matrix: - branch: ${{ fromJSON(needs.get-maintenance-branches.outputs.branches) }} + branch: ${{ fromJSON(env.MAINTENANCE_BRANCHES) }} uses: ./.github/workflows/backport-workflow.yml with: label-to-check-for: '["backport to ${{ matrix.branch }}"]'