Skip to content

Commit 38edf50

Browse files
fix git check: back on top
1 parent bc163ff commit 38edf50

File tree

1 file changed

+13
-13
lines changed
  • projects/optic/src/commands

1 file changed

+13
-13
lines changed

projects/optic/src/commands/run.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
import { compute } from './diff/compute';
1919
import { uploadDiff } from './diff/upload-diff';
2020
import chalk from 'chalk';
21-
import { alias, flushEvents, trackEvent } from '../segment';
21+
import { flushEvents, trackEvent } from '../segment';
2222
import { BreakingChangesRuleset } from '@useoptic/standard-rulesets';
2323
import { createOpticClient } from '../client/optic-backend';
2424
import fs from 'fs';
@@ -114,7 +114,7 @@ export function registerRunCommand(cli: Command, config: OpticCliConfig) {
114114
cli
115115
.command('run')
116116
.description(
117-
`Optic's workflow command: lint OpenAPI specifications, search for breaking changes, enforce custom API governance rules, automatically update your specs to match your tests traffic and post a friendly summary to the PR/MR and .`
117+
`Optic's workflow command: lint OpenAPI specifications, search for breaking changes, enforce custom API governance rules, and optionally check that your specs match your test traffic and post a friendly summary to the PR/MR.`
118118
)
119119
.configureHelp({ commandUsage: usage })
120120
.option(
@@ -291,21 +291,10 @@ export const getRunAction =
291291
const commentToken =
292292
process.env.GITHUB_TOKEN ?? process.env.OPTIC_GITLAB_TOKEN;
293293

294-
const currentBranch =
295-
getGithubBranchName() ??
296-
process.env.CI_COMMIT_REF_NAME ??
297-
(await getCurrentBranchName());
298-
299-
const currentBranchCloudTag = `gitbranch:${currentBranch}`;
300-
301294
const baseBranch =
302295
process.env.GITHUB_BASE_REF ??
303296
process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME;
304297

305-
const cloudTag = baseBranch
306-
? `gitbranch:${baseBranch}`
307-
: currentBranchCloudTag;
308-
309298
const isPR = config.isInCi && !!baseBranch;
310299

311300
trackEvent(
@@ -334,6 +323,17 @@ export const getRunAction =
334323
return;
335324
}
336325

326+
const currentBranch =
327+
getGithubBranchName() ??
328+
process.env.CI_COMMIT_REF_NAME ??
329+
(await getCurrentBranchName());
330+
331+
const currentBranchCloudTag = `gitbranch:${currentBranch}`;
332+
333+
const cloudTag = baseBranch
334+
? `gitbranch:${baseBranch}`
335+
: currentBranchCloudTag;
336+
337337
const authentified = config.isInCi
338338
? await authenticateCI(config)
339339
: await authenticateInteractive(config);

0 commit comments

Comments
 (0)