Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 13 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105551,14 +105551,20 @@ function loadOrBuildManifest(github, inputs) {
skipLabeling: inputs.skipLabeling,
}, inputs.path);
}
const manifestOverrides = inputs.fork || inputs.skipLabeling
? {
fork: inputs.fork,
skipLabeling: inputs.skipLabeling,
}
: {};
core.debug('Loading manifest from config file');
return release_please_1.Manifest.fromManifest(github, github.repository.defaultBranch, inputs.configFile, inputs.manifestFile, manifestOverrides);
return release_please_1.Manifest.fromManifest(github, github.repository.defaultBranch, inputs.configFile, inputs.manifestFile, {
fork: inputs.fork,
skipLabeling: inputs.skipLabeling,
}).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}`);
for (const path in manifest.repositoryConfig) {
manifest.repositoryConfig[path].changelogHost = inputs.changelogHost;
}
}
return manifest;
});
}
async function main(fetchOverride) {
core.info(`Running release-please version: ${release_please_1.VERSION}`);
Expand Down
23 changes: 15 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,27 @@ function loadOrBuildManifest(
inputs.path
);
}
const manifestOverrides = inputs.fork || inputs.skipLabeling
? {
fork: inputs.fork,
skipLabeling: inputs.skipLabeling,
}
: {};

Comment thread
vincentclee marked this conversation as resolved.
Outdated
core.debug('Loading manifest from config file');
return Manifest.fromManifest(
github,
github.repository.defaultBranch,
inputs.configFile,
inputs.manifestFile,
manifestOverrides
);
{
fork: inputs.fork,
skipLabeling: inputs.skipLabeling,
}
).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}`);
for (const path in manifest.repositoryConfig) {
manifest.repositoryConfig[path].changelogHost = inputs.changelogHost;
}
}
return manifest;
});
}

export async function main(fetchOverride?: any) {
Expand Down
20 changes: 20 additions & 0 deletions test/release-please.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,26 @@ describe('release-please-action', () => {
sinon.match({fork: true}),
);
});
it('allows specifying changelog-host', async () => {
restoreEnv = mockInputs({
'changelog-host': 'https://ghe.example.com',
});
fakeManifest.createReleases.resolves([]);
fakeManifest.createPullRequests.resolves([]);
await action.main(fetch);
sinon.assert.calledOnce(fakeManifest.createReleases);
sinon.assert.calledOnce(fakeManifest.createPullRequests);

// Test that fromManifest is called without changelogHost in overrides
Comment thread
ferrarimarco marked this conversation as resolved.
sinon.assert.calledWith(
fromManifestStub,
sinon.match.any,
sinon.match.string,
sinon.match.string,
sinon.match.string,
sinon.match(arg => !arg.hasOwnProperty('changelogHost')),
);
});
});

it('allows specifying manifest config paths', async () => {
Expand Down
Loading