Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cutover #1

Merged
merged 6 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [10.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion lib/jira.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type Version = Version2Models.Version;

export function makeClient(config: PluginConfig, _context: PluginContext): JiraClient {
if (!process.env.JIRA_AUTH) {
throw new Error('JIRA_AUTH environment variable is not set. Must be a JSON block.');
throw new Error('JIRA_AUTH environment variable is not set. Must be a JSON string.');
}
return new JiraClient({
host: config.jiraHost,
Expand Down
4 changes: 4 additions & 0 deletions lib/success.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@

context.logger.info(`Found ticket ${tickets.join(', ')}`);

if (tickets.length === 0) {
return;
}

const versionTemplate = _.template(config.releaseNameTemplate ?? DEFAULT_VERSION_TEMPLATE);
const newVersionName = versionTemplate({ version: context.nextRelease.version });

Expand All @@ -112,7 +116,7 @@
const jira = makeClient(config, context);

const project = await jira.projects.getProject({ projectIdOrKey: config.projectId });
const { id: releaseVersionId } = await findOrCreateVersion(config, context, jira, project.id, newVersionName, newVersionDescription);

Check failure on line 119 in lib/success.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

if (!releaseVersionId) {
throw new Error('Missing release version id!');
Expand Down
3 changes: 0 additions & 3 deletions lib/verifyConditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ export async function verifyConditions(config: PluginConfig, context: PluginCont
throw new SemanticReleaseError(`config.networkConcurrency must be an number greater than 0`);
}

if (!context.env.JIRA_AUTH) {
throw new SemanticReleaseError(`JIRA_AUTH must be a string`);
}
const jira = makeClient(config, context);
await jira.projects.getProject({ projectIdOrKey: config.projectId });
}
Loading
Loading