Caution
This project is no longer maintained.
This project is no longer maintained. In Juni 2023 GitHub released the first version of actions/create-github-app-token
. That project does the same as this one did and offers more features and security improvements. Therefore, this project is now deprecated and I suggest using actions/create-github-app-token
as a replacement. I've created vidavidorra/github-action-app-user
as an addtion to still get the user information. Please see the usage of vidavidorra/github-action-app-user
to to see an example of the combined replacement for the full functionality this action offered.
Authenticate as a GitHub App, from a GitHub Action or TypeScript/JavaScript code.
- Authenticate as a GitHub App.
- Fine control over permissions.
- No need for dedicated user for personal access token permission control.
- Use GitHub Actions to authenticate as a GitHub App.
- Authenticate as a GitHub App from TypeScript or JavaScript code.
GitHub App token can be used either as a GitHub Action, please see the GitHub Action usage instructions for that, or as a npm package. The following command can be used to install the npm package as a dependency. For the API of the npm packge, please see the API usage instructions.
$ npm install @vidavidorra/github-app-token
or
jobs:
my_first_job:
runs-on: ubuntu-latest
permissions: {}
steps:
- name: GitHub App token
id: app-token
uses: vidavidorra/github-app-token@1c002dd
with:
appId: ${{ secrets.APP_ID }}
privateKey: ${{ secrets.PRIVATE_KEY }}
- name: Use the token
run: # Some command using ${{ steps.app-token.outputs.token }}
name | type | required | description |
---|---|---|---|
appId |
integer | ✓ | ID of the GitHub App |
privateKey |
string | ✓ | private key of the GitHub App in PEM format |
repositories |
string | repositories to authenticate for | |
owner |
string | owner of the repositories to authenticate for | |
installationId |
integer | installation ID of the GitHub App installation | |
includeUserInformation |
boolean | whether or not to include user information in the outputs |
name | type | description |
---|---|---|
token |
string | GitHub App installation access token |
createdAt |
string | creation date of the token |
expiresAt |
string | expiration date of the token |
email |
string | email of the GitHub app user (optional) |
username |
string | username of the GitHub app user (optional) |
The authenticate
function is exported, with the same Inputs as the GitHub Action.
Please create an issue if you have a bug report, feature proposal or question that does not yet exist.
Please give this project a star ⭐ if you like it and consider becoming a sponsor to support this project.
Refer to the contributing guide detailed information about other contributions, like pull requests.
Please refer to the Security Policy on GitHub for the security policy.
This project is licensed under the GPLv3 license.
Copyright © 2022-2023 Jeroen de Bruijn
License details.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
The full text of the license is available in the LICENSE file in this repository and online.