Skip to content

Commit fb878a3

Browse files
authored
fix publish asction (#76)
1 parent cd8d73e commit fb878a3

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

.github/workflows/publish-build.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,41 @@ on:
1010
- Reflex Build Dev
1111
- Reflex Build Stg
1212
- Reflex Build Prod
13+
release_tag:
14+
description: 'Release tag (leave empty for latest)'
15+
required: false
16+
type: string
17+
1318
jobs:
19+
prepare-release-info:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
release_info: ${{ steps.get-release.outputs.result }}
23+
steps:
24+
- name: Get release info
25+
id: get-release
26+
uses: actions/github-script@v6
27+
with:
28+
github-token: ${{ secrets.GITHUB_TOKEN }}
29+
result-encoding: json
30+
script: |
31+
let release;
32+
if ('${{ github.event.inputs.release_tag }}') {
33+
release = await github.rest.repos.getReleaseByTag({
34+
owner: context.repo.owner,
35+
repo: context.repo.repo,
36+
tag: '${{ github.event.inputs.release_tag }}'
37+
});
38+
} else {
39+
release = await github.rest.repos.getLatestRelease({
40+
owner: context.repo.owner,
41+
repo: context.repo.repo
42+
});
43+
}
44+
return release.data;
45+
1446
trigger-second-repo:
47+
needs: prepare-release-info
1548
runs-on: ubuntu-latest
1649
steps:
1750
- name: Trigger second repo
@@ -20,4 +53,4 @@ jobs:
2053
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
2154
repository: reflex-dev/flexgen
2255
event-type: release
23-
client-payload: '{"release": ${{ toJson(github.event.release) }}}'
56+
client-payload: ${{ needs.prepare-release-info.outputs.release_info }}

0 commit comments

Comments
 (0)