Skip to content

Commit a0cd0f5

Browse files
authored
feat: allow repo url to be set as argument to GitHub action (#380)
1 parent 9bd5f99 commit a0cd0f5

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Automate releases with Conventional Commit Messages.
6262
| `changelog-path` | configure alternate path for `CHANGELOG.md`. Default `CHANGELOG.md` |
6363
| `github-api-url` | configure github API URL. Default `https://api.github.com` |
6464
| `--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\>") |
65+
| `repo-url` | configure github repository URL. Default `process.env.GITHUB_REPOSITORY` |
6566

6667
| output | description |
6768
|:---:|---|

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ inputs:
7676
description: 'configure github API URL. Default `https://api.github.com`'
7777
required: false
7878
default: ''
79+
repo-url:
80+
description: 'configure github repository URL. Default `process.env.GITHUB_REPOSITORY`'
81+
required: false
82+
default: ''
7983

8084
runs:
8185
using: 'node12'

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function getGitHubInput () {
2424
return {
2525
fork: getBooleanInput('fork'),
2626
defaultBranch: core.getInput('default-branch') || undefined,
27-
repoUrl: process.env.GITHUB_REPOSITORY,
27+
repoUrl: core.getInput('repo-url') || process.env.GITHUB_REPOSITORY,
2828
apiUrl: core.getInput('github-api-url') || GITHUB_API_URL,
2929
token: core.getInput('token', { required: true })
3030
}
@@ -100,7 +100,7 @@ async function main () {
100100
if (!command || command === GITHUB_RELEASE_COMMAND) {
101101
const releaseCreated = await factory.runCommand(GITHUB_RELEASE_COMMAND, {
102102
label: RELEASE_LABEL,
103-
repoUrl: process.env.GITHUB_REPOSITORY,
103+
repoUrl,
104104
packageName,
105105
path,
106106
monorepoTags,

0 commit comments

Comments
 (0)