Skip to content

Commit 8f3db02

Browse files
CopilotEMaher
andauthored
chore: rename prevEnv to previousEnvironment per code review feedback
Agent-Logs-Url: https://github.com/Azure/apiops-cli/sessions/af96f6ab-4bfa-485c-8b3e-a19edca3cb60 Co-authored-by: EMaher <9244742+EMaher@users.noreply.github.com>
1 parent d9170d6 commit 8f3db02

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/templates/azure-devops/publish-pipeline.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export function generatePublishPipeline(config: PublishPipelineConfig): string {
1212
const envValues = config.environments.map((env) => ` - '${env}'`).join('\n');
1313

1414
const stages = config.environments.map((env, idx) => {
15-
const prevEnv = idx > 0 ? config.environments[idx - 1] : null;
16-
const dependsOnProp = prevEnv ? ` dependsOn: Publish_${prevEnv}\n` : '';
17-
const approvalComment = prevEnv
15+
const previousEnvironment = idx > 0 ? config.environments[idx - 1] : null;
16+
const dependsOnProp = previousEnvironment ? ` dependsOn: Publish_${previousEnvironment}\n` : '';
17+
const approvalComment = previousEnvironment
1818
? ` # To require human approval before this stage:
1919
# Go to Pipelines > Environments > ${env} in Azure DevOps and add an approval check.
2020
`

src/templates/github-actions/publish-workflow.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ export function generatePublishWorkflow(config: PublishWorkflowConfig): string {
1212
const envChoices = config.environments.map((env) => ` - ${env}`).join('\n');
1313

1414
const envJobs = config.environments.map((env, idx) => {
15-
const prevEnv = idx > 0 ? config.environments[idx - 1] : null;
16-
const needs = prevEnv ? `[get-commit, publish-${prevEnv}]` : 'get-commit';
15+
const previousEnvironment = idx > 0 ? config.environments[idx - 1] : null;
16+
const needs = previousEnvironment ? `[get-commit, publish-${previousEnvironment}]` : 'get-commit';
1717

1818
const jobComment = idx === 0
1919
? ` # Automatically deploys to ${env} on push to main (incremental mode) or when selected via workflow_dispatch`
20-
: ` # Deploys to ${env} after ${prevEnv} succeeds (sequential promotion).
20+
: ` # Deploys to ${env} after ${previousEnvironment} succeeds (sequential promotion).
2121
# To require human approval before deploying to ${env}:
2222
# 1. Go to Settings > Environments > ${env} in your GitHub repository
2323
# 2. Add "Required reviewers" under "Environment protection rules"`;

0 commit comments

Comments
 (0)