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

Commit

Permalink
feat: add changelog-host input to action.yml (#948)
Browse files Browse the repository at this point in the history
This was originally part of
[3.3.0](https://github.com/google-github-actions/release-please-action/blob/main/CHANGELOG.md#330-2022-08-10)
(and fixed in
[3.4.1](https://github.com/google-github-actions/release-please-action/blob/main/CHANGELOG.md#341-2022-08-24)
to default to `github.server_url`). However, it was not part of 4.0.0.

Without this input, you have to provide both config and manifest files
in order to set the `changelog-host` option.

With this input, you can simply provide `release-type` and
`changelog-host` without the need for config and manifest files. Also,
since it defaults to `github.server_url`, most users will not even have
to set it.

Signed-off-by: Paavo Bennett <[email protected]>
Co-authored-by: Jeff Ching <[email protected]>
  • Loading branch information
eliw00d and chingor13 authored Mar 11, 2024
1 parent 078b9b8 commit 863b06f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ inputs:
description: 'if set to true, then do not try to open pull requests'
required: false
default: false
changelog-host:
description: 'The proto://host where commits live. Default `https://github.com`'
required: false
default: ${{ github.server_url }}
runs:
using: 'node20'
main: 'dist/index.js'
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const DEFAULT_CONFIG_FILE = 'release-please-config.json';
const DEFAULT_MANIFEST_FILE = '.release-please-manifest.json';
const DEFAULT_GITHUB_API_URL = 'https://api.github.com';
const DEFAULT_GITHUB_GRAPHQL_URL = 'https://api.github.com';
const DEFAULT_GITHUB_SERVER_URL = 'https://github.com';

interface Proxy {
host: string;
Expand All @@ -40,6 +41,7 @@ interface ActionInputs {
skipGitHubPullRequest?: boolean;
fork?: boolean;
includeComponentInTag?: boolean;
changelogHost: string;
}

function parseInputs(): ActionInputs {
Expand All @@ -60,6 +62,7 @@ function parseInputs(): ActionInputs {
skipGitHubPullRequest: getOptionalBooleanInput('skip-github-pull-request'),
fork: getOptionalBooleanInput('fork'),
includeComponentInTag: getOptionalBooleanInput('include-component-in-tag'),
changelogHost: core.getInput('changelog-host') || DEFAULT_GITHUB_SERVER_URL,
};
return inputs;
}
Expand Down Expand Up @@ -88,6 +91,7 @@ function loadOrBuildManifest(
{
releaseType: inputs.releaseType,
includeComponentInTag: inputs.includeComponentInTag,
changelogHost: inputs.changelogHost,
},
{
fork: inputs.fork,
Expand Down Expand Up @@ -205,4 +209,4 @@ if (require.main === module) {
main().catch(err => {
core.setFailed(`release-please failed: ${err.message}`)
})
}
}

0 comments on commit 863b06f

Please sign in to comment.