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

Commit

Permalink
feat(input): add github GraphQL URL configuration for input (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoHsu committed Oct 14, 2021
1 parent 413fe37 commit 720c5f8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Automate releases with Conventional Commit Messages.
| `github-api-url` | configure github API URL. Default `https://api.github.com` |
| `--signoff` | Add [`Signed-off-by`](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff) line at the end of the commit log message using the user and email provided. (format "Name \<email@example.com\>") |
| `repo-url` | configure github repository URL. Default `process.env.GITHUB_REPOSITORY` |
| `github-graphql-url` | configure github GraphQL URL. Default `https://api.github.com` |

| output | description |
|:---:|---|
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ inputs:
description: 'configure github API URL. Default `https://api.github.com`'
required: false
default: ''
github-graphql-url:
description: 'configure github GraphQL URL. Default `https://api.github.com`'
required: false
default: ''
repo-url:
description: 'configure github repository URL. Default `process.env.GITHUB_REPOSITORY`'
required: false
Expand Down
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const RELEASE_LABEL = 'autorelease: pending'
const GITHUB_RELEASE_COMMAND = 'github-release'
const GITHUB_RELEASE_PR_COMMAND = 'release-pr'
const GITHUB_API_URL = 'https://api.github.com'
const GITHUB_GRAPHQL_URL = 'https://api.github.com'

const signoff = core.getInput('signoff') || undefined

Expand All @@ -26,6 +27,7 @@ function getGitHubInput () {
defaultBranch: core.getInput('default-branch') || undefined,
repoUrl: core.getInput('repo-url') || process.env.GITHUB_REPOSITORY,
apiUrl: core.getInput('github-api-url') || GITHUB_API_URL,
graphqlUrl: core.getInput('github-graphql-url') || GITHUB_GRAPHQL_URL,
token: core.getInput('token', { required: true })
}
}
Expand Down Expand Up @@ -81,7 +83,7 @@ async function main () {
return await runManifest(command)
}

const { token, fork, defaultBranch, apiUrl, repoUrl } = getGitHubInput()
const { token, fork, defaultBranch, apiUrl, graphqlUrl, repoUrl } = getGitHubInput()

const bumpMinorPreMajor = getBooleanInput('bump-minor-pre-major')
const bumpPatchForMinorPreMajor = getBooleanInput('bump-patch-for-minor-pre-major')
Expand Down Expand Up @@ -109,7 +111,8 @@ async function main () {
releaseType,
defaultBranch,
pullRequestTitlePattern,
apiUrl
apiUrl,
graphqlUrl
})

if (releaseCreated) {
Expand All @@ -129,6 +132,7 @@ async function main () {
packageName,
path,
apiUrl,
graphqlUrl,
repoUrl,
fork,
token,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"homepage": "https://github.com/bcoe/release-please-action#readme",
"dependencies": {
"@actions/core": "^1.2.6",
"release-please": "^12.5.0"
"release-please": "^12.6.0"
},
"devDependencies": {
"@vercel/ncc": "^0.27.0",
Expand Down

0 comments on commit 720c5f8

Please sign in to comment.