1
0
mirror of https://github.com/joaquinjsb/gitea-release-please-action synced 2026-05-12 22:11:35 +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

9
dist/index.js vendored
View File

@@ -116257,6 +116257,7 @@ function getOptionalBooleanInput(name) {
}
function loadOrBuildManifest(github, inputs) {
if (inputs.releaseType) {
core.debug('Building manifest from config');
return release_please_1.Manifest.fromConfig(github, github.repository.defaultBranch, {
releaseType: inputs.releaseType,
}, {
@@ -116268,6 +116269,7 @@ function loadOrBuildManifest(github, inputs) {
fork: inputs.fork,
}
: {};
core.debug('Loading manifest from config file');
return release_please_1.Manifest.fromManifest(github, github.repository.defaultBranch, inputs.configFile, inputs.manifestFile, manifestOverrides);
}
async function main() {
@@ -116275,10 +116277,12 @@ async function main() {
const github = await getGitHubInstance(inputs);
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());
}
}
@@ -116356,6 +116360,11 @@ function outputPRs(prs) {
core.setOutput('prs', JSON.stringify(prs));
}
}
if (require.main === require.cache[eval('__filename')]) {
main().catch(err => {
core.setFailed(`release-please failed: ${err.message}`);
});
}
})();