Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 2 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ async function run(): Promise<void> {
core.debug(`No version available for '${featureId}', so no repo tag was added for Feature`);
continue;
}
if (!(await addRepoTagForPublishedTag('feature', featureId, version))) {
continue;
}
await addRepoTagForPublishedTag('feature', featureId, version);
}
}
}
Expand All @@ -116,9 +114,7 @@ async function run(): Promise<void> {
core.debug(`No version available for '${templateId}', so no repo tag was added for Feature`);
continue;
}
if (!(await addRepoTagForPublishedTag('template', templateId, version))) {
continue;
}
await addRepoTagForPublishedTag('template', templateId, version);
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ export async function isDevcontainerCliAvailable(cliDebugMode = false): Promise<
}

export async function addRepoTagForPublishedTag(type: string, id: string, version: string): Promise<boolean> {
if (process.env.GITHUB_TOKEN === undefined || process.env.GITHUB_TOKEN === '') {
core.warning('GITHUB_TOKEN is not set, skipping adding repo tag.');
return false;
}

const octokit = github.getOctokit(process.env.GITHUB_TOKEN || '');
const tag = `${type}_${id}_${version}`;
core.info(`Adding repo tag '${tag}'...`);
Expand Down