You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 5, 2018. It is now read-only.
Hello, I've seen a couple of issues on here and believe that people are having trouble with push_files because of the treatment of URL's. I'm in a situation where I need to modify a script to enable anybody on staff to execute this thing, and instead of assuming they have their SSH keys setup properly with the github enterprise account, I enforce that they have $TEACHERS_PET_GITHUB_TOKEN set.
This works well for cloning and creating repos etc, but the issue with push_files is that it defaults to using ssh for some reason, unlike the other commands. That is, even if I tell it --token.
Example:
Functioning as-expected for create repos
tp_auth="--web=$gh_web --api=$ghb_api --organization=$ghb_org --username=$grader_netid --token"
tp_spec="--students=$student_file --repository=$repo_name"
# Create the repositories as private
teachers_pet create_repos $tp_auth $tp_spec --no-public
these variables simply specify the url's, the username (which will almost certainly be different than their git config), and --token (already previously verified the token is set).
However,
teachers_pet push_files $tp_auth $tp_spec
will fail, and inspection reveals this is what happened:
Basically, even though I asked for --token it will use my ssh key which is not associated (intentionally) with my enterprise github account. In my script I am specifically cloning this repo as
because the repo does not follow the standard "team-repo_name" teachers_pet is expecting (which is nbd), but I just wanted to explain how that origin got that way in the first place.
So I think the reason people are having trouble with push_files may be because it is grabbing ssh keys without asking, and my understanding of the code is the --token doesn't apply.
I don't know how to fix it (ruby is beautiful, but quite foreign), but figured I'd post this in case it is an easy fix. Let me know if you need more data.
Edit: to clarify, I solved it by just using --ssh=<enterprise url> and adding my ssh key to the enterprise account, but I feel like the push_files command should be able to use just the --token. But perhaps not?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello, I've seen a couple of issues on here and believe that people are having trouble with
push_files
because of the treatment of URL's. I'm in a situation where I need to modify a script to enable anybody on staff to execute this thing, and instead of assuming they have their SSH keys setup properly with the github enterprise account, I enforce that they have$TEACHERS_PET_GITHUB_TOKEN
set.This works well for cloning and creating repos etc, but the issue with
push_files
is that it defaults to usingssh
for some reason, unlike the other commands. That is, even if I tell it--token
.Example:
Functioning as-expected for create repos
these variables simply specify the url's, the username (which will almost certainly be different than their git config), and
--token
(already previously verified the token is set).However,
will fail, and inspection reveals this is what happened:
Basically, even though I asked for
--token
it will use myssh
key which is not associated (intentionally) with my enterprise github account. In my script I am specifically cloning this repo asbecause the repo does not follow the standard "team-repo_name" teachers_pet is expecting (which is nbd), but I just wanted to explain how that
origin
got that way in the first place.So I think the reason people are having trouble with
push_files
may be because it is grabbingssh
keys without asking, and my understanding of the code is the--token
doesn't apply.I don't know how to fix it (ruby is beautiful, but quite foreign), but figured I'd post this in case it is an easy fix. Let me know if you need more data.
Edit: to clarify, I solved it by just using
--ssh=<enterprise url>
and adding my ssh key to the enterprise account, but I feel like thepush_files
command should be able to use just the--token
. But perhaps not?The text was updated successfully, but these errors were encountered: