1
0
mirror of https://github.com/joaquinjsb/gitea-release-please-action synced 2026-05-11 00:51:12 +02:00

build: actually run main() in index.ts (#882)

When converting to typescript we didn't call the main() method if
index.ts/js is invoked directly.
This commit is contained in:
Jeff Ching
2023-11-30 12:33:12 -08:00
committed by GitHub
parent c5182cc8b1
commit 546de4e1ec
3 changed files with 21 additions and 2 deletions

View File

@@ -107,6 +107,7 @@ function loadOrBuildManifest(
inputs: ActionInputs
): Promise<Manifest> {
if (inputs.releaseType) {
core.debug('Building manifest from config');
return Manifest.fromConfig(
github,
github.repository.defaultBranch,
@@ -124,6 +125,7 @@ function loadOrBuildManifest(
fork: inputs.fork,
}
: {};
core.debug('Loading manifest from config file');
return Manifest.fromManifest(
github,
github.repository.defaultBranch,
@@ -139,11 +141,13 @@ export async function main() {
if (!inputs.skipGitHubRelease) {
const manifest = await loadOrBuildManifest(github, inputs);
core.debug('Creating pull requests');
outputReleases(await manifest.createReleases());
}
if (!inputs.skipGitHubPullRequest) {
const manifest = await loadOrBuildManifest(github, inputs);
core.debug('Creating pull requests');
outputPRs(await manifest.createPullRequests());
}
}
@@ -220,3 +224,9 @@ function outputPRs(prs: (PullRequest | undefined)[]) {
core.setOutput('prs', JSON.stringify(prs));
}
}
if (require.main === module) {
main().catch(err => {
core.setFailed(`release-please failed: ${err.message}`)
})
}