diff --git a/.ci/bump-golang.yml b/.ci/bump-golang.yml index af7726e681b..27b113cfaaf 100644 --- a/.ci/bump-golang.yml +++ b/.ci/bump-golang.yml @@ -1,6 +1,6 @@ --- name: Bump golang-version to latest version -pipelineid: 'updatecli-bump-golang' +pipelineid: 'updatecli-bump-golang-{{ requiredEnv "GITHUB_BRANCH" }}' actions: default: @@ -10,8 +10,8 @@ actions: spec: labels: - automation - - backport-skip - dependencies + - '{{ requiredEnv "GITHUB_LABELS"}}' description: |- ### What Bump go release version with the latest release. diff --git a/.github/workflows/bump-golang.yml b/.github/workflows/bump-golang.yml index f5b858db828..8327c43951a 100644 --- a/.github/workflows/bump-golang.yml +++ b/.github/workflows/bump-golang.yml @@ -10,8 +10,33 @@ permissions: contents: read jobs: + + labels: + runs-on: ubuntu-latest + timeout-minutes: 1 + outputs: + backports: ${{ steps.labels.outputs.backports }} + steps: + - id: generate + name: Generate matrix + uses: elastic/apm-pipeline-library/.github/actions/elastic-stack-snapshot-branches@current + with: + exclude-branches: '7.17,main' + - uses: actions/github-script@v7 + id: labels + env: + BRANCHES: ${{ steps.generate.outputs.branches }} + with: + script: | + // We only support the latest minor version + const branches = JSON.parse(process.env.BRANCHES) + .sort((a, b) => parseFloat(b) - parseFloat(a)); + const latest = branches[0] + core.setOutput("backports", `backport-${branches[0].trim()}`) + bump: runs-on: ubuntu-latest + needs: [labels] steps: - uses: actions/checkout@v4 @@ -22,6 +47,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.UPDATECLI_GH_TOKEN }} GITHUB_BRANCH: 'main' + GITHUB_LABELS: ${{ needs.labels.outputs.backports }} bump-7: runs-on: ubuntu-latest @@ -36,6 +62,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.UPDATECLI_GH_TOKEN }} GITHUB_BRANCH: '7.17' + GITHUB_LABELS: 'backport-skip' notify: runs-on: ubuntu-latest