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:
10
src/index.ts
10
src/index.ts
@@ -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}`)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user