Skip to content

Training scripts on GHEC #406

Open
Open

Description

@edinc

Hello,

Has anyone tried running the scripts to generate the repositories on an GHEC instance? I have an SSO account and a organisation (with Owner privileges), but somehow it still doesn't work.
I have created a PAT Token and authorised it for SAML single sign-on. Tried providing both api.github.com and github.com/enterprises/<customer-name> in the .trainingmanualrc file. When running the 'Confirm Setup' step, this is what I get:

Checking if  is accessible via the API...
Can't access the organization via the API.

Is it even possible to run the scripts on GHEC or I need to follow the steps from the README regarding GitHub Enterprise Server?

Activity

  1. amyschoen commented on Nov 8, 2023

    @amyschoen
    Collaborator

    I have a local branch where I've been working on it, but I haven't uploaded any of it here yet. What kind of access are you setting up in your token? I've found that for ours, we need someone who has org admin level access because we need to be able to invite users into our training org in GHEC. I haven't had any difficulties accessing the API for our set up for GHEC.

  2. amyschoen commented on Nov 8, 2023

    @amyschoen
    Collaborator

    Realized I should look at my .trainingmanualrc. I have this set for URLs:

    export INSTANCE_URL='api.github.com'
    export ROOT_URL='github.com'
    

    I'd have to look at what changes I made specifically for GHEC since it's been a few months. I haven't contributed back yet because what I have is a bit hacky, and I want to clean things up first. I know when we worked on supporting both GHES and .com, there are conditionals that treat the two differently in some ways. As written, the scripts would treat GHEC as .com based on the base URLs which isn't always what we want. There are some subtleties, and GHEC does behave more like GHES.

  3. edinc commented on Nov 15, 2023

    @edinc
    Author

    Thank you for the input @amyschoen. I found a way with a small workaround.

    • Gave the PAT token full permission and authorised it for SAML single sign-on
    • My .trainingmanualrc file
    export TOKEN_OWNER='SSO account'
    export TEACHER_PAT='TOKEN'
    export INSTANCE_URL='api.github.com'
    export ROOT_URL='github.com'
    export CLASS_ORG='Organization name'
    
    • The script still didn't want to create the caption-this repository, but I used the template to generate the repository manually within the Organization
    • After that I manually added all the participants. First to the Organization, than to the caption-this repository
    • Once the participants were added as Collaborators, I was able to generate the conflict-practice and github-games repositories with all the corresponding Issues and Pull Requests for all the participants, using the script

    Maybe this will help someone else who has issues setting up the training on GHEC.

  4. amyschoen commented on Nov 15, 2023

    @amyschoen
    Collaborator

    What is your repo visibility @edinc? We don't allow public which is what was breaking repo generation via the scripts for me. My fix was to create repos as internal for GHEC.

    Editing to add that I also needed to add logic to invite users to the org. Just need to get some time to do clean up before I can contribute my updates back.

  5. reopened this on Nov 16, 2023
  6. edinc commented on Nov 16, 2023

    @edinc
    Author

    The repo visibility was Internal. I reopened the Issue, you can link it together with you contributions when you open a PR 😃

  7. amyschoen commented on Nov 16, 2023

    @amyschoen
    Collaborator

    I'll try to get my changes pushed here in early December even if it's just a branch so you can test if my changes work for your GHEC instance as well. Taking a lot of year-end PTO, so no promises on timeframe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions