Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit 546de4e

Browse files
authored
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.
1 parent c5182cc commit 546de4e

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

.github/workflows/release-please.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
runs-on: ubuntu-latest
6363
needs: [build]
6464
steps:
65-
- uses: GoogleCloudPlatform/release-please-action@main
65+
- uses: google-github-actions/release-please-action@main
6666
id: release
6767
with:
6868
token: ${{ secrets.GITHUB_TOKEN }}
@@ -90,7 +90,7 @@ jobs:
9090
- release-please-release
9191
steps:
9292
- id: release-pr
93-
uses: GoogleCloudPlatform/release-please-action@main
93+
uses: google-github-actions/release-please-action@main
9494
with:
9595
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
9696
release-type: node

dist/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116257,6 +116257,7 @@ function getOptionalBooleanInput(name) {
116257116257
}
116258116258
function loadOrBuildManifest(github, inputs) {
116259116259
if (inputs.releaseType) {
116260+
core.debug('Building manifest from config');
116260116261
return release_please_1.Manifest.fromConfig(github, github.repository.defaultBranch, {
116261116262
releaseType: inputs.releaseType,
116262116263
}, {
@@ -116268,17 +116269,20 @@ function loadOrBuildManifest(github, inputs) {
116268116269
fork: inputs.fork,
116269116270
}
116270116271
: {};
116272+
core.debug('Loading manifest from config file');
116271116273
return release_please_1.Manifest.fromManifest(github, github.repository.defaultBranch, inputs.configFile, inputs.manifestFile, manifestOverrides);
116272116274
}
116273116275
async function main() {
116274116276
const inputs = parseInputs();
116275116277
const github = await getGitHubInstance(inputs);
116276116278
if (!inputs.skipGitHubRelease) {
116277116279
const manifest = await loadOrBuildManifest(github, inputs);
116280+
core.debug('Creating pull requests');
116278116281
outputReleases(await manifest.createReleases());
116279116282
}
116280116283
if (!inputs.skipGitHubPullRequest) {
116281116284
const manifest = await loadOrBuildManifest(github, inputs);
116285+
core.debug('Creating pull requests');
116282116286
outputPRs(await manifest.createPullRequests());
116283116287
}
116284116288
}
@@ -116356,6 +116360,11 @@ function outputPRs(prs) {
116356116360
core.setOutput('prs', JSON.stringify(prs));
116357116361
}
116358116362
}
116363+
if (require.main === require.cache[eval('__filename')]) {
116364+
main().catch(err => {
116365+
core.setFailed(`release-please failed: ${err.message}`);
116366+
});
116367+
}
116359116368

116360116369
})();
116361116370

src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ function loadOrBuildManifest(
107107
inputs: ActionInputs
108108
): Promise<Manifest> {
109109
if (inputs.releaseType) {
110+
core.debug('Building manifest from config');
110111
return Manifest.fromConfig(
111112
github,
112113
github.repository.defaultBranch,
@@ -124,6 +125,7 @@ function loadOrBuildManifest(
124125
fork: inputs.fork,
125126
}
126127
: {};
128+
core.debug('Loading manifest from config file');
127129
return Manifest.fromManifest(
128130
github,
129131
github.repository.defaultBranch,
@@ -139,11 +141,13 @@ export async function main() {
139141

140142
if (!inputs.skipGitHubRelease) {
141143
const manifest = await loadOrBuildManifest(github, inputs);
144+
core.debug('Creating pull requests');
142145
outputReleases(await manifest.createReleases());
143146
}
144147

145148
if (!inputs.skipGitHubPullRequest) {
146149
const manifest = await loadOrBuildManifest(github, inputs);
150+
core.debug('Creating pull requests');
147151
outputPRs(await manifest.createPullRequests());
148152
}
149153
}
@@ -220,3 +224,9 @@ function outputPRs(prs: (PullRequest | undefined)[]) {
220224
core.setOutput('prs', JSON.stringify(prs));
221225
}
222226
}
227+
228+
if (require.main === module) {
229+
main().catch(err => {
230+
core.setFailed(`release-please failed: ${err.message}`)
231+
})
232+
}

0 commit comments

Comments
 (0)