File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ permissions:
44 contents : read
55
66on :
7+ workflow_dispatch :
78 push :
89 branches :
910 - main
Original file line number Diff line number Diff line change @@ -115,9 +115,35 @@ jobs:
115115 - *checkout
116116 - *install-rust
117117 - name : Create release PR
118+ id : release-pr
118119 uses : release-plz/action@v0.5
119120 with :
120121 command : release-pr
121122 env :
122123 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
123124 CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
125+ - name : Trigger CI for release PR
126+ uses : actions/github-script@v7
127+ with :
128+ github-token : ${{ secrets.GITHUB_TOKEN }}
129+ script : |
130+ const prOutputRaw = process.env.RELEASE_PLZ_PR;
131+ if (!prOutputRaw) {
132+ core.info('release-plz did not create or update a release PR; skipping CI trigger.');
133+ return;
134+ }
135+ const releasePr = JSON.parse(prOutputRaw);
136+ if (!releasePr?.head_branch) {
137+ core.info('release-plz PR output missing head branch; skipping CI trigger.');
138+ return;
139+ }
140+ const headRef = releasePr.head_branch;
141+ await github.rest.actions.createWorkflowDispatch({
142+ owner: context.repo.owner,
143+ repo: context.repo.repo,
144+ workflow_id: 'ci.yml',
145+ ref: headRef,
146+ });
147+ core.info(`Triggered CI workflow for ${headRef}.`);
148+ env :
149+ RELEASE_PLZ_PR : ${{ steps.release-pr.outputs.pr }}
You can’t perform that action at this time.
0 commit comments