jhudsl / OTTR_Template

OTTR for making courses! This is a template repo that helps people write 1 course but publish it in three places
https://www.ottrproject.org/
Creative Commons Attribution 4.0 International
15 stars 12 forks source link

How/where to add GH_PAT? Github's options may have been updated since instructions were written. #628

Closed RickSlc closed 1 year ago

RickSlc commented 1 year ago

Describe what is not working with the template or is unclear in the documentation

Hi, I am following the Getting Started instructions from https://www.ottrproject.org/getting_started.html#starting-a-new-ottr-course and it appears the options have been updated. There isn't an option Settings/Secrets and Repository Secrets any longer. The options are "Setting/Secrets and variables" with options Actions, Codebases, Dependabots. I have created a key for Dependabots but it doesn't appear to be working.

Please link to the specific course repository you are working on

https://www.ottrproject.org/getting_started.html#starting-a-new-ottr-course

To Reproduce

  1. Go to https://www.ottrproject.org/getting_started.html#starting-a-new-ottr-course
  2. Scroll down to '6. Set up your GitHub personal access token'
  3. Issue is described above.
  4. I believe my key was created wrong and it is causing an error on first pull request automation task "Make the branch fresh." OTTR Template has jhusdsl-robot collaborator access the
  5. This is the error info from github after pull request:
git config --local user.email "itcrtrainingnetwork@gmail.com"
git config --local user.name "jhudsl-robot"

  branch_name='preview-1'
  echo branch doesnt exist
  git checkout -b $branch_name || echo branch exists
  git push --set-upstream origin $branch_name
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    CHECK_QUIZZES: no
    URL_CHECKER: yes
    RENDER_PREVIEW: yes
    SPELL_CHECK: yes
    STYLE_CODE: yes
    DOCKER_TEST: no
    RENDER_BOOKDOWN: yes
    RENDER_LEANPUB: yes
    RENDER_COURSERA: no
    RENDERING_DOCKER_IMAGE: jhudsl/base_ottr:main
branch doesnt exist
Switched to a new branch 'preview-1'
remote: Permission to RickSlc/garde-courses.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/RickSlc/garde-courses/': The requested URL returned error: 40[3](https://github.com/RickSlc/garde-courses/actions/runs/4420071558/jobs/7749301334#step:5:3)
Error: Process completed with exit code 12[8](https://github.com/RickSlc/garde-courses/actions/runs/4420071558/jobs/7749301334#step:5:8).

Expected behavior

Improved/updated description for how to create the GH_PAT key.

Do I need to pass the GH_PAT key somewhere/to someone?

Github actions links

Screenshots

Additional context

cansavvy commented 1 year ago

@RickSlc Thanks for this issue. I'll look into it right away.

cansavvy commented 1 year ago

Did you make sure to give your github secret the scope of both repo and workflow as described here: https://www.ottrproject.org/getting_started.html#6_Set_up_your_GitHub_personal_access_token ?

RickSlc commented 1 year ago

Yes, my PAT has scope for both repo and workflow. (I'll be back in 2 weeks)

cansavvy commented 1 year ago

The other thing to check if you know the token has repo and workflow scopes is whether jhudsl-robot has been given write access. (Just read or triage access won't work).

RickSlc commented 1 year ago

Hi, I am back. The instructions state:

In your repository, go to your Settings > Collaborators & Teams and click on Add people. In the pop up window, search for and add jhudsl-robot.

(select collaborator)

Choose the write option then click Add jhudsl-robot to this repository.

In my case there is not a write option to select when I add a collaborator and I am not seeing where/how to check for write permissions.

Any chance we could zoom for a few minutes? Thanks!

cansavvy commented 1 year ago
230175023-04646b6a-ce62-4755-bab6-0ceda0fa3183

^ This setting was the issue. Going to update this in ottrproject.org