{"id":14986054,"url":"https://github.com/wow-actions/use-app-token","last_synced_at":"2025-05-06T18:07:59.205Z","repository":{"id":63649511,"uuid":"298289654","full_name":"wow-actions/use-app-token","owner":"wow-actions","description":"🔑 Run GitHub Actions as a GitHub App by using the app's authentication token","archived":false,"fork":false,"pushed_at":"2024-10-12T09:31:02.000Z","size":1857,"stargazers_count":30,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-21T01:01:26.677Z","etag":null,"topics":["github-actions","github-token"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wow-actions.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-24T13:36:21.000Z","updated_at":"2025-04-14T17:52:06.000Z","dependencies_parsed_at":"2024-08-13T14:30:13.498Z","dependency_job_id":"efd3ec82-8413-4815-8236-488c8f0fd0d3","html_url":"https://github.com/wow-actions/use-app-token","commit_stats":{"total_commits":91,"total_committers":6,"mean_commits":"15.166666666666666","dds":"0.10989010989010994","last_synced_commit":"60901999802f1fa132e41f9d30f6a19c85bf5b35"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wow-actions%2Fuse-app-token","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wow-actions%2Fuse-app-token/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wow-actions%2Fuse-app-token/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wow-actions%2Fuse-app-token/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wow-actions","download_url":"https://codeload.github.com/wow-actions/use-app-token/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252563734,"owners_count":21768510,"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":["github-actions","github-token"],"created_at":"2024-09-24T14:12:12.404Z","updated_at":"2025-05-06T18:07:59.180Z","avatar_url":"https://github.com/wow-actions.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e🔑 Use App Token\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003eRun GitHub Actions as a GitHub App by using the app's authentication token\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/wow-actions/use-app-token/actions/workflows/release.yml\"\u003e\u003cimg alt=\"build\" src=\"https://img.shields.io/github/actions/workflow/status/wow-actions/use-app-token/release.yml?branch=master\u0026logo=github\u0026style=flat-square\" \u003e\u003c/a\u003e\n  \u003ca href=\"/wow-actions/use-app-token/blob/master/LICENSE\"\u003e\u003cimg alt=\"MIT License\" src=\"https://img.shields.io/github/license/wow-actions/use-app-token?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.typescriptlang.org\" rel=\"nofollow\"\u003e\u003cimg alt=\"Language\" src=\"https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/wow-actions/use-app-token/pulls\"\u003e\u003cimg alt=\"PRs Welcome\" src=\"https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square\" \u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/marketplace/actions/use-app-token\" rel=\"nofollow\"\u003e\u003cimg alt=\"website\" src=\"https://img.shields.io/static/v1?label=\u0026labelColor=505050\u0026message=Marketplace\u0026color=0076D6\u0026style=flat-square\u0026logo=google-chrome\u0026logoColor=0076D6\" \u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis GitHub Action can be used to **impersonate** a GitHub App when `secrets.GITHUB_TOKEN`'s limitations are too restrictive and a personal access token is not suitable. [`secrets.GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) has limitations such as [not being able to triggering a new workflow from another workflow](https://github.community/t5/GitHub-Actions/Triggering-a-new-workflow-from-another-workflow/td-p/31676). A workaround is to use a [personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) from a [personal user/bot account](https://help.github.com/en/github/getting-started-with-github/types-of-github-accounts#personal-user-accounts). However, for organizations, GitHub Apps are [a more appropriate automation solution](https://developer.github.com/apps/differences-between-apps/#machine-vs-bot-accounts).\n\nWe can also use an app token to [custom an action's name and avatar](https://github.community/t/change-bots-name-avatar/18349).\n\n![screenshot](https://github.com/wow-actions/use-app-token/blob/master/screenshots/screenshot.jpg?raw=true)\n\n## Usage\n\nBefore staring, we should get the _\"APP ID\"_ and _\"Private Key\"_ in the app's setting page. For example, find the two values in my app's setting page [https://github.com/settings/apps/wow-actions-bot](https://github.com/settings/apps/wow-actions-bot).\n\nGet the app's _\"APP ID\"_\n\n![get-app-id](https://github.com/wow-actions/use-app-token/blob/master/screenshots/get-app-id.jpg?raw=true)\n\nGet or create a _\"Private Key\"_\n\n![get-private-key](https://github.com/wow-actions/use-app-token/blob/master/screenshots/get-private-key.jpg?raw=true)\n\n**Do not have a Github App? Get a quick start with [probot](https://probot.github.io/).**\n\nThen add _\"APP ID\"_ and _\"Private Key\"_ to the target [repo's secrets](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets). For example, we can add two secrets named `APP_ID` and `PRIVATE_KEY` with corresponding values.\n\n![secrets](https://github.com/wow-actions/use-app-token/blob/master/screenshots/secrets.jpg?raw=true)\n\nNow we can config our workflows.\n\n### Method 1: Use action's output in the next steps\n\n```yml\njobs:\n  run:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: wow-actions/use-app-token@v2\n        id: generate_token\n        with:\n          app_id: ${{ secrets.APP_ID }}\n          private_key: ${{ secrets.PRIVATE_KEY }}\n\n      # Use token in next steps\n      - uses: 'any other action'\n        with:\n          # Use app token in outpus of the 'generate_token' step\n          GITHUB_TOKEN: ${{ steps.generate_token.outputs.BOT_TOKEN }}\n        env:\n          # Use app name in outpus of the 'generate_token' step\n          GIT_AUTHOR_NAME: ${{ steps.generate_token.outputs.BOT_NAME }}[bot]\n          GIT_AUTHOR_EMAIL: ${{ steps.generate_token.outputs.BOT_NAME }}[bot]@users.noreply.github.com\n          GIT_COMMITTER_NAME: ${{ steps.generate_token.outputs.BOT_NAME }}[bot]\n          GIT_COMMITTER_EMAIL: ${{ steps.generate_token.outputs.BOT_NAME }}[bot]@users.noreply.github.com\n```\n\n### Method 2: Use environment variables in the next steps\n\n```yml\njobs:\n  run:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: wow-actions/use-app-token@v2\n        with:\n          app_id: ${{ secrets.APP_ID }}\n          private_key: ${{ secrets.PRIVATE_KEY }}\n\n      # Use token in next steps\n      - uses: 'any other action'\n        with:\n          # Use app token in the environment variable named \"BOT_TOKEN\"\n          GITHUB_TOKEN: ${{ env.BOT_TOKEN }}\n        env:\n          # Use app name in the environment variable named \"BOT_NAME\"\n          GIT_AUTHOR_NAME: ${{ env.BOT_NAME }}[bot]\n          GIT_AUTHOR_EMAIL: ${{ env.BOT_NAME }}[bot]@users.noreply.github.com\n          GIT_COMMITTER_NAME: ${{ env.BOT_NAME }}[bot]\n          GIT_COMMITTER_EMAIL: ${{ env.BOT_NAME }}[bot]@users.noreply.github.com\n```\n\n### Method 3: Use secrets in the next steps\n\n```yml\njobs:\n  run:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: wow-actions/use-app-token@v2\n        with:\n          app_id: ${{ secrets.APP_ID }}\n          private_key: ${{ secrets.PRIVATE_KEY }}\n          # Specify true to save app token and app slug into the secrets of current repository\n          secret: true\n          # Specify true to clean saved secrets when workflow run completed\n          clean: true\n      - uses: 'any other action'\n        with:\n          GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}\n        env:\n          GIT_AUTHOR_NAME: ${{ secrets.BOT_NAME }}[bot]\n          GIT_AUTHOR_EMAIL: ${{ secrets.BOT_NAME }}[bot]@users.noreply.github.com\n          GIT_COMMITTER_NAME: ${{ secrets.BOT_NAME }}[bot]\n          GIT_COMMITTER_EMAIL: ${{ secrets.BOT_NAME }}[bot]@users.noreply.github.com\n```\n\n### Inputs\n\nVarious inputs are defined to let you configure the action:\n\n\u003e Note: [Workflow command and parameter names are not case-sensitive](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#about-workflow-commands).\n\n| Name             | Description                                                                                                                                                                                                                                                                                                                       |    Default    |\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------:|\n| `app_id`         | The ID of the GitHub App. [Create an secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository) named `'APP_ID'` to store your app ID, then used by `${{ secrets.APP_ID }}`                                                |      N/A      |\n| `private_key`    | The private key of the GitHub App (can be Base64 encoded). [Create an secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository) named `'PRIVATE_KEY'` to store your app private key, then used by `${{ secrets.APP_ID }}` |      N/A      |\n| `fallback`       | The fallback token when app token generate failed                                                                                                                                                                                                                                                                                 |      N/A      |\n| `app_slug_name`  | The app slug name exported to `env` or saved to `secrets`                                                                                                                                                                                                                                                                         | `\"BOT_NAME\"`  |\n| `app_token_name` | The app token name exported to `env` or saved to `secrets`                                                                                                                                                                                                                                                                        | `\"BOT_TOKEN\"` |\n| `secret`         | Specify `true` to save app token and app slug into the secrets of current repository                                                                                                                                                                                                                                              |    `false`    |\n| `clean`          | Specify `true` to clean saved secrets when workflow run completed. Only used when `secret` specfiied to `true`                                                                                                                                                                                                                    |    `true`     |\n\n## License\n\nThe scripts and documentation in this project are released under the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwow-actions%2Fuse-app-token","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwow-actions%2Fuse-app-token","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwow-actions%2Fuse-app-token/lists"}