feat(release): Add dev support to patch2 workflow (#11460)

This commit is contained in:
Richie Foreman
2025-10-20 23:09:27 -04:00
committed by GitHub
parent fc4e10b537
commit 81772c4252
2 changed files with 20 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ on:
type: 'string' type: 'string'
default: 'main' default: 'main'
workflow_id: workflow_id:
description: 'The workflow to trigger. Defaults to patch-release.yml' description: 'The workflow to trigger. Defaults to release-patch-3-release.yml'
required: false required: false
type: 'string' type: 'string'
default: 'release-patch-3-release.yml' default: 'release-patch-3-release.yml'
@@ -37,11 +37,20 @@ on:
required: false required: false
type: 'boolean' type: 'boolean'
default: false default: false
environment:
description: 'Environment'
required: false
type: 'choice'
options:
- 'prod'
- 'dev'
default: 'prod'
jobs: jobs:
trigger-patch-release: trigger-patch-release:
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'" 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'"
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
environment: '${{ github.event.inputs.environment }}'
permissions: permissions:
actions: 'write' actions: 'write'
contents: 'write' contents: 'write'
@@ -74,5 +83,6 @@ jobs:
GITHUB_EVENT_PAYLOAD: '${{ toJSON(github.event) }}' GITHUB_EVENT_PAYLOAD: '${{ toJSON(github.event) }}'
FORCE_SKIP_TESTS: '${{ github.event.inputs.force_skip_tests }}' FORCE_SKIP_TESTS: '${{ github.event.inputs.force_skip_tests }}'
TEST_MODE: '${{ github.event.inputs.test_mode }}' TEST_MODE: '${{ github.event.inputs.test_mode }}'
ENVIRONMENT: '${{ github.event.inputs.environment }}'
run: | run: |
node scripts/releasing/patch-trigger.js --dry-run=${{ github.event.inputs.dry_run }} node scripts/releasing/patch-trigger.js --dry-run=${{ github.event.inputs.dry_run }}

View File

@@ -81,6 +81,11 @@ async function main() {
type: 'boolean', type: 'boolean',
default: false, default: false,
}) })
.option('environment', {
choices: ['prod', 'dev'],
type: 'string',
default: process.env.ENVIRONMENT || 'prod',
})
.example( .example(
'$0 --head-ref "hotfix/v0.5.3/preview/cherry-pick-abc1234" --test', '$0 --head-ref "hotfix/v0.5.3/preview/cherry-pick-abc1234" --test',
'Test channel detection logic', 'Test channel detection logic',
@@ -105,6 +110,7 @@ async function main() {
// Get inputs from CLI args or environment // Get inputs from CLI args or environment
const headRef = argv.headRef || process.env.HEAD_REF; const headRef = argv.headRef || process.env.HEAD_REF;
const environment = argv.environment;
const body = argv.prBody || process.env.PR_BODY || ''; const body = argv.prBody || process.env.PR_BODY || '';
const isDryRun = argv.dryRun || body.includes('[DRY RUN]'); const isDryRun = argv.dryRun || body.includes('[DRY RUN]');
const forceSkipTests = const forceSkipTests =
@@ -226,6 +232,8 @@ async function main() {
'--field', '--field',
`release_ref=${releaseRef}`, `release_ref=${releaseRef}`,
'--field', '--field',
`environment=${environment}`,
'--field',
originalPr ? `original_pr=${originalPr.toString()}` : 'original_pr=', originalPr ? `original_pr=${originalPr.toString()}` : 'original_pr=',
]; ];
@@ -259,6 +267,7 @@ async function main() {
const commentBody = `🚀 **Patch Release Started!** const commentBody = `🚀 **Patch Release Started!**
**📋 Release Details:** **📋 Release Details:**
- **Environment**: \`${environment}\`
- **Channel**: \`${channel}\` → publishing to npm tag \`${npmTag}\` - **Channel**: \`${channel}\` → publishing to npm tag \`${npmTag}\`
- **Version**: \`${version}\` - **Version**: \`${version}\`
- **Hotfix PR**: Merged ✅ - **Hotfix PR**: Merged ✅