opensafely-core / sysadmin

Various scripts and tools for administering OpenSAFELY organisation and infrastructure
0 stars 0 forks source link

Update ORG_READONLY_TOKEN #147

Closed madwort closed 8 months ago

madwort commented 8 months ago

CI is failing eg https://github.com/opensafely-core/sysadmin/actions/runs/6484492958 . Token was last updated Oct 5 2022, so has probably recently expired.

madwort commented 8 months ago

see https://github.com/opensafely-core/sysadmin/blob/4991e8864da78bc4e78aa6e39a06c16e5a74af0f/.github/workflows/tests.yaml#L24-L27 and https://github.com/opensafely-core/sysadmin/blob/4991e8864da78bc4e78aa6e39a06c16e5a74af0f/client.py#L6-L11

madwort commented 8 months ago

I tried creating a PAT on my account with a selection of org & repo permissions, but was then met with

Traceback (most recent call last):
  File "manage-github.py", line 307, in <module>
    main()
  File "manage-github.py", line 270, in main
    for change in changes:
  File "manage-github.py", line 212, in manage_studies
    researchers = client.GithubTeam(org.get_team_by_slug('researchers'))
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/github/Organization.py", line 979, in get_team_by_slug
    headers, data = self._requester.requestJsonAndCheck(
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/github/Requester.py", line 353, in requestJsonAndCheck
    return self.__check(
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/github/Requester.py", line 378, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.UnknownObjectException: 404 {"message": "Not Found", "documentation_url": "https://docs.github.com/rest/teams/teams#get-a-team-by-name"}
madwort commented 8 months ago

@bloodearnest I assume you created this token, I have been unable to reproduce it - can you confirm what/where/etc it should be?

madwort commented 8 months ago

@bloodearnest has renewed the token

tweaked instructions here https://github.com/opensafely-core/sysadmin/pull/151