diff --git a/README.md b/README.md index c283e8d..158a46e 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,7 @@ Following environment variables can be used as `step.env` keys |----------------|---------------------------------------| | `GITHUB_TOKEN` | [GITHUB_TOKEN](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) as provided by `secrets` | | `GH_PAT` | Use a [Personal Access Token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) if you want to deploy to another repo | +| `GIT_DOMAIN` | Use another domain. Default `github.com` | ## Keep up-to-date with GitHub Dependabot diff --git a/dist/index.js b/dist/index.js index ad023ed..55bc2b2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -253,6 +253,7 @@ function run() { return __awaiter(this, void 0, void 0, function* () { try { const repo = core.getInput('repo') || process.env['GITHUB_REPOSITORY'] || ''; + const domain = process.env['GIT_DOMAIN'] || 'github.com'; const targetBranch = core.getInput('target_branch') || git.defaults.targetBranch; const keepHistory = /true/i.test(core.getInput('keep_history')); const allowEmptyCommit = /true/i.test(core.getInput('allow_empty_commit')); @@ -279,7 +280,7 @@ function run() { core.setFailed('You have to provide a GITHUB_TOKEN or GH_PAT'); return; } - remoteURL = remoteURL.concat('@github.com/', repo, '.git'); + remoteURL = remoteURL.concat('@', domain, '/', repo, '.git'); core.debug(`remoteURL=${remoteURL}`); const remoteBranchExists = yield git.remoteBranchExists(remoteURL, targetBranch); core.debug(`remoteBranchExists=${remoteBranchExists}`); diff --git a/src/main.ts b/src/main.ts index e06d412..7ff1676 100644 --- a/src/main.ts +++ b/src/main.ts @@ -9,6 +9,7 @@ import * as util from './util'; async function run() { try { const repo: string = core.getInput('repo') || process.env['GITHUB_REPOSITORY'] || ''; + const domain: string = process.env['GIT_DOMAIN'] || 'github.com'; const targetBranch: string = core.getInput('target_branch') || git.defaults.targetBranch; const keepHistory: boolean = /true/i.test(core.getInput('keep_history')); const allowEmptyCommit: boolean = /true/i.test(core.getInput('allow_empty_commit')); @@ -35,7 +36,7 @@ async function run() { core.setFailed('You have to provide a GITHUB_TOKEN or GH_PAT'); return; } - remoteURL = remoteURL.concat('@github.com/', repo, '.git'); + remoteURL = remoteURL.concat('@', domain, '/', repo, '.git'); core.debug(`remoteURL=${remoteURL}`); const remoteBranchExists: boolean = await git.remoteBranchExists(remoteURL, targetBranch);