Skip to content

Commit

Permalink
Added GIT_DOMAIN env variable to override default domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Libor Krzyzanek committed Feb 4, 2021
1 parent 2e4f8c2 commit eef7fed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand All @@ -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);
Expand Down

0 comments on commit eef7fed

Please sign in to comment.