Skip to content

Commit 852913f

Browse files
authored
ci: update release workflow (to notify downstream) (#800)
1 parent 4b1f9af commit 852913f

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

.github/workflows/pushv2.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,22 @@ jobs:
1313
- uses: actions/github-script@v7
1414
env:
1515
ACTOR: ${{ github.actor }}
16+
AUTHOR: ${{ github.event.head_commit.author.name }}
1617
MESSAGE: ${{ github.event.head_commit.message }}
1718
SHA: ${{ github.sha }}
1819
with:
1920
github-token: ${{ secrets.DOWNSTREAM_TOKEN }}
2021
script: |
21-
const { ACTOR, MESSAGE, SHA } = process.env;
22+
const { ACTOR, AUTHOR, MESSAGE, SHA } = process.env;
2223
const result = await github.rest.actions.createWorkflowDispatch({
2324
owner: '${{ secrets.DOWNSTREAM_OWNER }}',
2425
repo: '${{ secrets.DOWNSTREAM_REPO_V2 }}',
2526
workflow_id: '${{ secrets.DOWNSTREAM_WORKFLOW_ID_V2 }}',
2627
ref: 'main',
2728
inputs: {
28-
sha: SHA,
2929
actor: ACTOR,
30-
message: MESSAGE
30+
author: AUTHOR,
31+
message: MESSAGE,
32+
sha: SHA
3133
}
3234
});

.github/workflows/release.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,36 @@ jobs:
7171
registry: ghcr.io
7272
username: ${{ github.actor }}
7373
password: ${{ secrets.GITHUB_TOKEN }}
74-
- name: Load environment variables from .env
74+
- name: Load Environment Variables from .env
7575
uses: xom9ikk/dotenv@v2
76-
- name: Publish images
76+
- name: Publish Images
7777
if:
7878
needs.publish_common_utils.outputs.changeset_outputs_hasChangesets ==
7979
'false'
8080
run: make ${{ matrix.release }}
81+
- name: Get Downstream App Installation Token
82+
id: auth
83+
uses: actions/create-github-app-token@v2
84+
with:
85+
app-id: ${{ secrets.DOWNSTREAM_CH_APP_ID }}
86+
private-key: ${{ secrets.DOWNSTREAM_CH_APP_PRIVATE_KEY }}
87+
- name: Notify Downstream
88+
if:
89+
needs.publish_common_utils.outputs.changeset_outputs_hasChangesets ==
90+
'false'
91+
uses: actions/github-script@v7
92+
env:
93+
TAG: ${{ env.IMAGE_VERSION }}.${{ env.IMAGE_VERSION_SUB_TAG }}
94+
with:
95+
github-token: ${{ steps.auth.outputs.token }}
96+
script: |
97+
const { TAG } = process.env;
98+
const result = await github.rest.actions.createWorkflowDispatch({
99+
owner: '${{ secrets.DOWNSTREAM_CH_OWNER }}',
100+
repo: '${{ secrets.DOWNSTREAM_DP_REPO }}',
101+
workflow_id: '${{ secrets.DOWNSTREAM_DP_WORKFLOW_ID }}',
102+
ref: 'main',
103+
inputs: {
104+
tag: TAG
105+
}
106+
});

0 commit comments

Comments
 (0)