Skip to content

Commit

Permalink
Merge pull request #154 from asheeshdwivedi/add-support-for-private-repo
Browse files Browse the repository at this point in the history
chore:add-support-for-private-repo
  • Loading branch information
TriPSs committed May 26, 2022
2 parents 90f5749 + 97921d5 commit a3e335a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ inputs:
description: 'Path to the pre-changelog-generation script file'
required: false

git-url:
description: 'Git Url'
default: 'github.com'
required: false

skip-ci:
description: 'Adds [skip ci] to commit message, to avoid triggering a new build'
default: 'true'
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = new (class Git {

const gitUserName = core.getInput('git-user-name')
const gitUserEmail = core.getInput('git-user-email')
const gitUrl = core.getInput('git-url')

// if the env is dont-use-git then we mock exec as we are testing a workflow
if (ENV === 'dont-use-git') {
Expand All @@ -38,7 +39,7 @@ module.exports = new (class Git {

// Update the origin
if (githubToken) {
this.updateOrigin(`https://x-access-token:${githubToken}@github.com/${GITHUB_REPOSITORY}.git`)
this.updateOrigin(`https://x-access-token:${githubToken}@${gitUrl}/${GITHUB_REPOSITORY}.git`)
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ async function run() {
const skipEmptyRelease = core.getInput('skip-on-empty').toLowerCase() === 'true'
const conventionalConfigFile = core.getInput('config-file-path')
const preChangelogGenerationFile = core.getInput('pre-changelog-generation')
const gitUrl = core.getInput('git-url')
const skipCi = core.getInput('skip-ci')

if (skipCi) {
Expand All @@ -58,6 +59,7 @@ async function run() {
core.info(`Using "${tagPrefix}" as tag prefix`)
core.info(`Using "${outputFile}" as output file`)
core.info(`Using "${conventionalConfigFile}" as config file`)
core.info(`Using "${gitUrl}" as gitUrl`)

if (preCommitFile) {
core.info(`Using "${preCommitFile}" as pre-commit script`)
Expand Down

0 comments on commit a3e335a

Please sign in to comment.