Skip to content

Commit 4963c0b

Browse files
authored
Ensure java updator runs on all active branches (#18408)
* Ensure java updator runs on all active branches Previously the java updator action would run against only the main branch when the schedule triggered. This is because the schedule action only tracks the default branch in a repo. The other branches could be triggered manually with a workflow dispatch trigger (along with configuring "which branch to run workflow from"). This old pattern is now replaced with a matrix job which runs the action across all the active branches. This allows the schedule to update everything and reduces manual inputs when triggering with workflow dispatch. * Use elastic/oblt-actions/elastic/active-branches Rather than use a static list, use the active-branches action to fill in matrix
1 parent 3ca7395 commit 4963c0b

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/bump-java-version.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,35 @@ on:
88

99

1010
jobs:
11+
filter:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 1
14+
permissions:
15+
contents: read
16+
outputs:
17+
matrix: ${{ steps.generator.outputs.matrix }}
18+
steps:
19+
- id: generator
20+
uses: elastic/oblt-actions/elastic/active-branches@v1
21+
with:
22+
exclude-branches: "7.17"
23+
filter-branches: true
1124
bump:
1225
permissions:
1326
contents: write
1427
pull-requests: write
1528
runs-on: ubuntu-latest
29+
needs: [filter]
30+
strategy:
31+
matrix: ${{ fromJson(needs.filter.outputs.matrix) }}
1632
steps:
1733
- uses: actions/checkout@v5
18-
34+
with:
35+
ref: ${{ matrix.branch }}
1936
- uses: elastic/oblt-actions/updatecli/run@v1
2037
with:
2138
command: apply --config .ci/updatecli/bump-java-version.yml --values .ci/updatecli/values.d/scm.yml
2239
version-file: .updatecli-version
2340
env:
2441
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25-
LOGSTASH_BRANCH: ${{ github.ref_name }}
42+
LOGSTASH_BRANCH: ${{ matrix.branch }}

0 commit comments

Comments
 (0)