Skip to content

Commit

Permalink
updatecli: add backport labels (#13571)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Jul 4, 2024
1 parent b99e36b commit 4400426
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .ci/bump-golang.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bump golang-version to latest version
pipelineid: 'updatecli-bump-golang'
pipelineid: 'updatecli-bump-golang-{{ requiredEnv "GITHUB_BRANCH" }}'

actions:
default:
Expand All @@ -10,8 +10,8 @@ actions:
spec:
labels:
- automation
- backport-skip
- dependencies
- '{{ requiredEnv "GITHUB_LABELS"}}'
description: |-
### What
Bump go release version with the latest release.
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/bump-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4400426

Please sign in to comment.