Skip to content

Commit 81772c4

Browse files
feat(release): Add dev support to patch2 workflow (#11460)
1 parent fc4e10b commit 81772c4

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

.github/workflows/release-patch-2-trigger.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
type: 'string'
1919
default: 'main'
2020
workflow_id:
21-
description: 'The workflow to trigger. Defaults to patch-release.yml'
21+
description: 'The workflow to trigger. Defaults to release-patch-3-release.yml'
2222
required: false
2323
type: 'string'
2424
default: 'release-patch-3-release.yml'
@@ -37,11 +37,20 @@ on:
3737
required: false
3838
type: 'boolean'
3939
default: false
40+
environment:
41+
description: 'Environment'
42+
required: false
43+
type: 'choice'
44+
options:
45+
- 'prod'
46+
- 'dev'
47+
default: 'prod'
4048

4149
jobs:
4250
trigger-patch-release:
4351
if: "(github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'hotfix/')) || github.event_name == 'workflow_dispatch'"
4452
runs-on: 'ubuntu-latest'
53+
environment: '${{ github.event.inputs.environment }}'
4554
permissions:
4655
actions: 'write'
4756
contents: 'write'
@@ -74,5 +83,6 @@ jobs:
7483
GITHUB_EVENT_PAYLOAD: '${{ toJSON(github.event) }}'
7584
FORCE_SKIP_TESTS: '${{ github.event.inputs.force_skip_tests }}'
7685
TEST_MODE: '${{ github.event.inputs.test_mode }}'
86+
ENVIRONMENT: '${{ github.event.inputs.environment }}'
7787
run: |
7888
node scripts/releasing/patch-trigger.js --dry-run=${{ github.event.inputs.dry_run }}

scripts/releasing/patch-trigger.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ async function main() {
8181
type: 'boolean',
8282
default: false,
8383
})
84+
.option('environment', {
85+
choices: ['prod', 'dev'],
86+
type: 'string',
87+
default: process.env.ENVIRONMENT || 'prod',
88+
})
8489
.example(
8590
'$0 --head-ref "hotfix/v0.5.3/preview/cherry-pick-abc1234" --test',
8691
'Test channel detection logic',
@@ -105,6 +110,7 @@ async function main() {
105110

106111
// Get inputs from CLI args or environment
107112
const headRef = argv.headRef || process.env.HEAD_REF;
113+
const environment = argv.environment;
108114
const body = argv.prBody || process.env.PR_BODY || '';
109115
const isDryRun = argv.dryRun || body.includes('[DRY RUN]');
110116
const forceSkipTests =
@@ -226,6 +232,8 @@ async function main() {
226232
'--field',
227233
`release_ref=${releaseRef}`,
228234
'--field',
235+
`environment=${environment}`,
236+
'--field',
229237
originalPr ? `original_pr=${originalPr.toString()}` : 'original_pr=',
230238
];
231239

@@ -259,6 +267,7 @@ async function main() {
259267
const commentBody = `🚀 **Patch Release Started!**
260268
261269
**📋 Release Details:**
270+
- **Environment**: \`${environment}\`
262271
- **Channel**: \`${channel}\` → publishing to npm tag \`${npmTag}\`
263272
- **Version**: \`${version}\`
264273
- **Hotfix PR**: Merged ✅

0 commit comments

Comments
 (0)