Skip to content

Commit 0a94b48

Browse files
committed
Refactor downstream re-build CI
1 parent 3e754a4 commit 0a94b48

File tree

2 files changed

+34
-18
lines changed

2 files changed

+34
-18
lines changed

.github/workflows/main.yml

+5-18
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,8 @@ jobs:
8181
trigger-dep-build:
8282
name: Trigger downstream builds
8383
needs: [build]
84-
if: ${{ github.event_name == 'push' }}
85-
runs-on: ubuntu-latest
86-
87-
strategy:
88-
fail-fast: false
89-
matrix:
90-
repo: [ 'FasterXML/jackson-databind' ]
91-
92-
steps:
93-
- name: Repository dispatch
94-
uses: peter-evans/repository-dispatch@v3
95-
with:
96-
# Does regular token work within same org?
97-
token: ${{ secrets.REPO_DISPATCH }}
98-
repository: ${{ matrix.repo }}
99-
event-type: jackson-core-pushed
100-
# Could push information on what was built but not yet
101-
client-payload: '{"version": "N/A" }'
84+
# Only for pushes to default branch
85+
if: ${{ github.event_name == 'push' && github.event.ref_name == github.event.repository.default_branch }}
86+
uses: ./.github/workflows/trigger_dep_builds.yml
87+
secrets:
88+
token: ${{ secrets.REPO_DISPATCH }}
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Reusable workflow; extracted for maintainability
2+
3+
name: Trigger downstream builds
4+
on:
5+
workflow_call:
6+
secrets:
7+
token:
8+
required: true
9+
10+
jobs:
11+
trigger-dep-build:
12+
name: Trigger downstream builds
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
repo:
19+
- 'FasterXML/jackson-databind'
20+
21+
steps:
22+
- name: Repository dispatch
23+
uses: peter-evans/repository-dispatch@v3
24+
with:
25+
token: ${{ secrets.token }}
26+
repository: ${{ matrix.repo }}
27+
event-type: jackson-databind-pushed
28+
# Could push information on what was built but not yet
29+
client-payload: '{"version": "N/A" }'

0 commit comments

Comments
 (0)