Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added GIT_DOMAIN env variable to override default domain #133

Merged
merged 1 commit into from Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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