Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Manage GitHub Secrets Using GitHub REST API

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

List Secrets in a Repository

<github_rest_api.github.Repository at 0x7ffb2c33be00>
[{'name': 'GITHUBACTIONS', 'created_at': '2026-06-20T17:35:49Z', 'updated_at': '2026-06-20T17:35:49Z'}]

List Secrets in a Organization

<github_rest_api.github.Organization at 0x7ffb24611160>
[{'name': 'DOCKER_BASE_DISPATCH', 'created_at': '2026-01-08T18:56:08Z', 'updated_at': '2026-01-08T19:01:57Z', 'visibility': 'selected', 'selected_repositories_url': 'https://api.github.com/orgs/legendu-net/actions/secrets/DOCKER_BASE_DISPATCH/repositories'}, {'name': 'GITHUBACTIONS', 'created_at': '2022-05-03T20:39:04Z', 'updated_at': '2026-06-20T17:34:54Z', 'visibility': 'all'}, {'name': 'PYPI_GITHUB_REST_API', 'created_at': '2026-01-02T01:23:21Z', 'updated_at': '2026-01-02T01:23:21Z', 'visibility': 'all'}, {'name': 'PYPI_TOKEN', 'created_at': '2026-01-02T01:30:11Z', 'updated_at': '2026-01-02T01:30:11Z', 'visibility': 'all'}]

Add/Update a Secret

[]
<Response [201]>
[{'name': 'MY_TOKEN', 'created_at': '2026-06-21T00:48:19Z', 'updated_at': '2026-06-21T00:48:19Z'}]

Delete a Secret

<Response [204]>
[]