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
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
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.