Skip to content

Commit 7257a3a

Browse files
authored
Revert "Add GitHub Enterprise support (ad-m#106)" (ad-m#107)
This reverts commit a7824cd.
1 parent a7824cd commit 7257a3a

File tree

4 files changed

+2
-11
lines changed

4 files changed

+2
-11
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ With ease:
77
- update new code placed in the repository, e.g. by running a linter on it,
88
- track changes in script results using Git as archive,
99
- publish page using GitHub-Pages,
10-
- push changes to a hosted GitHub Enterprise Server instance,
1110
- mirror changes to a separate repository.
1211

1312
## Usage
@@ -45,7 +44,6 @@ jobs:
4544
| name | value | default | description |
4645
| ---- | ----- | ------- | ----------- |
4746
| github_token | string | `${{ github.token }}` | [GITHUB_TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token). |
48-
| github_url | string | `${{ github.server_url }}` | Specify the GitHub Enterprise or GitHub url|
4947
| branch | string | (default) | Destination branch to push changes. <br /> Can be passed in using `${{ github.ref }}`. |
5048
| force | boolean | false | Determines if force push is used. |
5149
| tags | boolean | false | Determines if `--tags` is used. |

action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ inputs:
99
description: 'GitHub token or PAT token'
1010
required: true
1111
default: ${{ github.token }}
12-
github_url:
13-
description: 'GitHub url or GitHub Enterprise url'
14-
required: true
15-
default: ${{ github.server_url }}
1612
repository:
1713
description: 'Repository name to push. Default or empty value represents current github repository (${GITHUB_REPOSITORY})'
1814
default: ''

start.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,19 @@ const trim = (value, charlist) => trimLeft(trimRight(value, charlist));
4242
const main = async () => {
4343
let branch = process.env.INPUT_BRANCH;
4444
const repository = trim(process.env.INPUT_REPOSITORY || process.env.GITHUB_REPOSITORY);
45-
const github_url = trim(process.env.INPUT_GITHUB_URL)
4645
if (!branch) {
4746
const headers = {
4847
'User-Agent': 'github.com/ad-m/github-push-action'
4948
};
5049
if (process.env.INPUT_GITHUB_TOKEN) headers.Authorization = `token ${process.env.INPUT_GITHUB_TOKEN}`;
51-
const api_url = github_url === 'github.com' ? 'api.github.com' : github_url + '/api/v3';
52-
const body = JSON.parse(await get(`https://${api_url}/repos/${repository}`, { headers }))
50+
const body = JSON.parse(await get(`https://api.github.com/repos/${repository}`, { headers }))
5351
branch = body.default_branch;
5452
}
5553
await exec('bash', [path.join(__dirname, './start.sh')], {
5654
env: {
5755
...process.env,
5856
INPUT_BRANCH: branch,
5957
INPUT_REPOSITORY: repository,
60-
INPUT_GITHUB_URL: github_url,
6158
}
6259
});
6360
};

start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ fi
2323

2424
cd ${INPUT_DIRECTORY}
2525

26-
remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@${GITHUB_URL}/${REPOSITORY}.git"
26+
remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git"
2727

2828
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS;

0 commit comments

Comments
 (0)