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

Add GitHub Enterprise support #106

Merged
merged 3 commits into from Feb 18, 2022
Merged

Add GitHub Enterprise support #106

merged 3 commits into from Feb 18, 2022

Conversation

ZPascal
Copy link
Collaborator

@ZPascal ZPascal commented Feb 13, 2022

Hi @ad-m, I've modified the push action a bit to specify the used GitHub URL and make it possible to support GitHub Enterprise instances.

Regards,

ZPascal

start.js Outdated Show resolved Hide resolved
@ad-m
Copy link
Owner

ad-m commented Feb 17, 2022

I don't have access to GitHub Enterprise, so I merge as is and I hope that it works. Could you verify by testing uses: ad-m/git-push-action@master?

@ZPascal
Copy link
Collaborator Author

ZPascal commented Feb 17, 2022

@ad-m Sure, I can test it.

action.yml Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@ad-m ad-m merged commit a7824cd into ad-m:master Feb 18, 2022
ad-m added a commit that referenced this pull request Feb 18, 2022
ad-m added a commit that referenced this pull request Feb 18, 2022
@ad-m
Copy link
Owner

ad-m commented Feb 18, 2022

I reversed that PR as it break build. https://github.com/ad-m/github-push-action/runs/5245447913?check_suite_focus=true Feel free to resubmit after fixing that build.

Should we use github.api_url? See https://docs.github.com/en/actions/learn-github-actions/contexts#github-context

if (!branch) {
const headers = {
'User-Agent': 'github.com/ad-m/github-push-action'
};
if (process.env.INPUT_GITHUB_TOKEN) headers.Authorization = `token ${process.env.INPUT_GITHUB_TOKEN}`;
const body = JSON.parse(await get(`https://api.github.com/repos/${repository}`, { headers }))
const api_url = github_url === 'github.com' ? 'api.github.com' : github_url + '/api/v3';
Copy link
Contributor

@jackton1 jackton1 Feb 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ad-m This is the source of the bug.

@ZPascal the url also contains https:// so we also need to account for that

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, for the hint. I've opened a fresh modified draft PR.

@jackton1
Copy link
Contributor

jackton1 commented Feb 18, 2022

@ad-m does the test also run on PR’s from forks ?

We might’ve caught this earlier.

@ZPascal ZPascal mentioned this pull request Feb 18, 2022
1 task
ZPascal pushed a commit to ZPascal/github-push-action that referenced this pull request Apr 18, 2022
* Update the GitHub action

Update build.yml

Remove push command

Add GitHub Enterprise support   (ad-m#106)

* Add GitHub url and GitHub Enterprise support

* Add review improvements

* Modify the default value to github.server_url

Revert "Add GitHub Enterprise support   (ad-m#106)" (ad-m#107)

This reverts commit a7824cd.

Add a PR validation action (ad-m#109)

Added workaround as suggested by the git itself (ad-m#112)

* Added workaround as suggested by the git itself

* Update start.sh

Co-authored-by: Pascal Zimmermann <Z_pascal@yahoo.de>

Co-authored-by: aleksandr.abroskin <aleksandr.abroskin@getmoss.com>
Co-authored-by: Adam Dobrawy <ad-m@users.noreply.github.com>
Co-authored-by: Pascal Zimmermann <Z_pascal@yahoo.de>

Update the PR and remove the test mode

Delete build-pr.yml

Add first version of deploy keys support

Update the README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants