Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105614,7 +105614,7 @@ function loadOrBuildManifest(github, inputs) {
}
: {};
core.debug('Loading manifest from config file');
return release_please_1.Manifest.fromManifest(github, github.repository.defaultBranch, inputs.configFile, inputs.manifestFile, manifestOverrides).then(manifest => {
return release_please_1.Manifest.fromManifest(github, github.repository.defaultBranch, inputs.configFile, inputs.manifestFile, manifestOverrides, inputs.path, inputs.releaseAs).then(manifest => {
// Override changelogHost for all paths if provided as action input and different from default
if (inputs.changelogHost && inputs.changelogHost !== DEFAULT_GITHUB_SERVER_URL) {
core.debug(`Overriding changelogHost to: ${inputs.changelogHost}`);
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ function loadOrBuildManifest(
github.repository.defaultBranch,
inputs.configFile,
inputs.manifestFile,
manifestOverrides
manifestOverrides,
inputs.path,
inputs.releaseAs,
).then(manifest => {
// Override changelogHost for all paths if provided as action input and different from default
if (inputs.changelogHost && inputs.changelogHost !== DEFAULT_GITHUB_SERVER_URL) {
Expand Down
78 changes: 76 additions & 2 deletions test/release-please.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,31 @@ describe('release-please-action', () => {
sinon.match.any,
'dev',
sinon.match.string,
sinon.match.string
sinon.match.string,
sinon.match.object,
sinon.match.any,
sinon.match.any,
);
});
it('allows specifying path', async () => {
restoreEnv = mockInputs({
path: 'packages/a',
});
fakeManifest.createReleases.resolves([]);
fakeManifest.createPullRequests.resolves([]);
await action.main(fetch);
sinon.assert.calledOnce(fakeManifest.createReleases);
sinon.assert.calledOnce(fakeManifest.createPullRequests);

sinon.assert.calledWith(
fromManifestStub,
sinon.match.any,
sinon.match.string,
sinon.match.string,
sinon.match.string,
sinon.match.object,
'packages/a',
sinon.match.any,
);
});
it('allows specifying fork', async () => {
Expand All @@ -289,6 +313,53 @@ describe('release-please-action', () => {
sinon.match.string,
sinon.match.string,
sinon.match({fork: true}),
sinon.match.any,
sinon.match.any,
);
});
it('allows specifying release-as', async () => {
restoreEnv = mockInputs({
'release-as': '2.0.0',
});
fakeManifest.createReleases.resolves([]);
fakeManifest.createPullRequests.resolves([]);
await action.main(fetch);
sinon.assert.calledOnce(fakeManifest.createReleases);
sinon.assert.calledOnce(fakeManifest.createPullRequests);

sinon.assert.calledWith(
fromManifestStub,
sinon.match.any,
sinon.match.string,
sinon.match.string,
sinon.match.string,
sinon.match.object,
sinon.match.any,
'2.0.0',
);
});
it('allows overriding release-as when both manifest config and input are provided', async () => {
restoreEnv = mockInputs({
'config-file': 'path/to/config.json',
'manifest-file': 'path/to/manifest.json',
'release-as': '2.0.0',
path: 'packages/a',
});
fakeManifest.createReleases.resolves([]);
fakeManifest.createPullRequests.resolves([]);
await action.main(fetch);
sinon.assert.calledOnce(fakeManifest.createReleases);
sinon.assert.calledOnce(fakeManifest.createPullRequests);

sinon.assert.calledWith(
fromManifestStub,
sinon.match.any,
sinon.match.string,
'path/to/config.json',
'path/to/manifest.json',
sinon.match.object,
'packages/a',
'2.0.0',
);
});
it('allows specifying changelog-host', async () => {
Expand Down Expand Up @@ -386,7 +457,10 @@ describe('release-please-action', () => {
sinon.match.any,
sinon.match.string,
'path/to/config.json',
'path/to/manifest.json'
'path/to/manifest.json',
sinon.match.any,
sinon.match.any,
sinon.match.any,
);
});

Expand Down