{"id":16129171,"url":"https://github.com/laughedelic/github_app_auth","last_synced_at":"2025-03-18T14:30:35.001Z","repository":{"id":44621922,"uuid":"354573996","full_name":"laughedelic/github_app_auth","owner":"laughedelic","description":"Tiny Deno library and CLI to authenticate as a GitHub App and generate installation tokens","archived":false,"fork":false,"pushed_at":"2022-02-04T02:24:29.000Z","size":21,"stargazers_count":8,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-28T10:03:26.201Z","etag":null,"topics":["cli","deno","github-api","github-app-token"],"latest_commit_sha":null,"homepage":"https://deno.land/x/github_app_auth","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laughedelic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-04T15:07:55.000Z","updated_at":"2023-12-05T15:25:50.000Z","dependencies_parsed_at":"2022-09-05T22:51:45.434Z","dependency_job_id":null,"html_url":"https://github.com/laughedelic/github_app_auth","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laughedelic%2Fgithub_app_auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laughedelic%2Fgithub_app_auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laughedelic%2Fgithub_app_auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laughedelic%2Fgithub_app_auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laughedelic","download_url":"https://codeload.github.com/laughedelic/github_app_auth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243933378,"owners_count":20370989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","deno","github-api","github-app-token"],"created_at":"2024-10-09T22:09:20.548Z","updated_at":"2025-03-18T14:30:34.726Z","avatar_url":"https://github.com/laughedelic.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub App auth for Deno\n\nA minimal Deno library and a CLI app to authenticate as a GitHub App installation.\n\n## Usage\n\n### CLI\n\n#### Installation\n\n```shell\ndeno install --allow-net=api.github.com https://deno.land/x/github_app_auth/cli.ts\n```\n\nThen you can use it as `github_app_auth ...`.\n\n#### Expected inputs\n\n- `app-id`: you can find it in the application settings\n- `private-key`: Base64-encoded content of the private key `.pem` file you got when you created the app\n- `installation-id`: organization or user installation ID you want to get access to\n- `repositories` (optional, trail-arg): list of repositories to give access to; if not provided, it will be all repositories that the installation can access\n\nSee the [API endpoint documentation](https://docs.github.com/en/rest/reference/apps#create-an-installation-access-token-for-an-app) for more info.\n\n#### GitHub API URL\n\nIf you need to change the default GitHub API URL, you can do it by setting the `GITHUB_API_URL` env var and adding `--allow-env=GITHUB_API_URL` when you install the script:\n\n```shell\nexport GITHUB_API_URL='...'\ndeno install --allow-net=\"$GITHUB_API_URL\" --allow-env='GITHUB_API_URL' https://deno.land/x/github_app_auth/cli.ts\n```\n\nOr use `--allow-net --allow-env` for simplicity.\n\n#### Examples\n\nGiven app ID, private key and then installation ID it will create a new installation access token and print it to the standard output:\n\n```shell\n$ github_app_auth 123456 $(base64 \u003c private-key.pem) 12345678\nghs_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n```\n\nIf you don't know the installation ID, you can run it with only the first two arguments and get a list of the app installations:\n\n```shell\n$ github_app_auth 123456 $(base64 \u003c private-key.pem)\n[\n  {\n    \"id\": 12345678,\n    ...\n```\n\nYou can use generated tokens to make requests on behalf on the app. Here are some examples using GitHub's official CLI `gh`, but you can also do it with `curl` or any other tool by adding the `Authorization: token ...` header.\n\n```shell\n$ GITHUB_TOKEN=$(github_app_auth 123456 $(base64 \u003c private-key.pem) 12345678)\n\n$ gh auth status\ngithub.com\n  ✓ Logged in to github.com as your-app-name[bot] (GITHUB_TOKEN)\n  ✓ Git operations for github.com configured to use https protocol.\n  ✓ Token: *******************\n\n$ gh api installation/repositories --jq '.repositories[].name'\nrepo1\nrepo2\n...\n\n$ gh api repos/:owner/repo1/releases\n...\n```\n\nCheck out [`gh api` docs](https://cli.github.com/manual/gh_api) for more examples and full feature list.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaughedelic%2Fgithub_app_auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaughedelic%2Fgithub_app_auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaughedelic%2Fgithub_app_auth/lists"}