1
0
mirror of https://github.com/joaquinjsb/gitea-release-please-action synced 2026-05-12 18:21:36 +02:00

feat(input): add github API URL configuration for input (#368)

This commit is contained in:
Neo Hsu
2021-09-24 05:37:49 +08:00
committed by GitHub
parent 56e7d78b8a
commit fd7f2fff26
2 changed files with 3 additions and 1 deletions

View File

@@ -60,6 +60,7 @@ Automate releases with Conventional Commit Messages.
| `default-branch` | branch to open pull release PR against (detected by default) | | `default-branch` | branch to open pull release PR against (detected by default) |
| `pull-request-title-pattern` | title pattern used to make release PR, defaults to using `chore${scope}: release${component} ${version}`. | | `pull-request-title-pattern` | title pattern used to make release PR, defaults to using `chore${scope}: release${component} ${version}`. |
| `changelog-path` | configure alternate path for `CHANGELOG.md`. Default `CHANGELOG.md` | | `changelog-path` | configure alternate path for `CHANGELOG.md`. Default `CHANGELOG.md` |
| `github-api-url` | configure github API URL. Default `https://api.github.com` |
| output | description | | output | description |
|:---:|---| |:---:|---|

View File

@@ -7,6 +7,7 @@ const MANIFEST_COMMANDS = ['manifest', 'manifest-pr']
const RELEASE_LABEL = 'autorelease: pending' const RELEASE_LABEL = 'autorelease: pending'
const GITHUB_RELEASE_COMMAND = 'github-release' const GITHUB_RELEASE_COMMAND = 'github-release'
const GITHUB_RELEASE_PR_COMMAND = 'release-pr' const GITHUB_RELEASE_PR_COMMAND = 'release-pr'
const GITHUB_API_URL = 'https://api.github.com'
function getBooleanInput (input) { function getBooleanInput (input) {
const trueValue = ['true', 'True', 'TRUE', 'yes', 'Yes', 'YES', 'y', 'Y', 'on', 'On', 'ON'] const trueValue = ['true', 'True', 'TRUE', 'yes', 'Yes', 'YES', 'y', 'Y', 'on', 'On', 'ON']
@@ -22,7 +23,7 @@ function getGitHubInput () {
fork: getBooleanInput('fork'), fork: getBooleanInput('fork'),
defaultBranch: core.getInput('default-branch') || undefined, defaultBranch: core.getInput('default-branch') || undefined,
repoUrl: process.env.GITHUB_REPOSITORY, repoUrl: process.env.GITHUB_REPOSITORY,
apiUrl: 'https://api.github.com', apiUrl: core.getInput('github-api-url') || GITHUB_API_URL,
token: core.getInput('token', { required: true }) token: core.getInput('token', { required: true })
} }
} }