Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philips-software/app-token-action
GitHub action to obatin app token
https://github.com/philips-software/app-token-action
action actions github-action github-actions
Last synced: 2 months ago
JSON representation
GitHub action to obatin app token
- Host: GitHub
- URL: https://github.com/philips-software/app-token-action
- Owner: philips-software
- License: mit
- Created: 2021-03-09T12:48:49.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-31T21:01:59.000Z (4 months ago)
- Last Synced: 2024-10-14T14:03:26.529Z (3 months ago)
- Topics: action, actions, github-action, github-actions
- Language: TypeScript
- Homepage:
- Size: 2.17 MB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# App token action
> [!IMPORTANT]
> This action is deprecated. Please migrate to the [github-app-token-action](https://github.com/actions/create-github-app-token).
>
> Migration is almost straight forward, be-aware that GitHub actions requires the key as input and not the base64 encoded version of the private key. See [here](https://github.com/actions/create-github-app-token?tab=readme-ov-file#private-key) how to do that securely.A GitHub action that obtains a token for an app authorization which can used instead of a personal access token (PAT) for example. Currently the *app* and *installation* scope are supported. For more details check out the GitHub App authentication [docs](https://docs.github.com/en/free-pro-team@latest/developers/apps/authenticating-with-github-apps)
Before the action can be used the APP has to be installed on the subject repository or in the organization scope.
## Description
Action will set application or application installation token as output.
## Inputs
| parameter | description | required | default |
| --- | --- | --- | --- |
| app_id | Application ID | `true` | |
| app_base64_private_key | Application SSH private key as base64 | `true` | |
| auth_type | Authorization type, either app or installation | `false` | app |
| org | Name of the org, if not provided will be read from the event. | `false` | |## Outputs
| parameter | description |
| --- | --- |
| token | Application token |## Runs
This action is a `node20` action.
## Usage
Below an example snippet how to use the action.
```yml
job:
name: Get App token
id: get_token
runs-on: self-hosted
steps:
- uses: philips-software/app-token-action@
with:
app_id: ${{ secrets.APP_ID }}
app_base64_private_key: ${{ secrets.APP_BASE64_PRIVATE_KEY }}
auth_type: installation
- uses: a-next-action
with:
token: ${{ steps.get_token.outputs.token }}```
## Development
Standard commands such as lint, test and build are available via yarn. Check [package.json] for more details.
### Test locally
Running locally requires you hav have an app in your org that is installed on one or more repositories. To run the local ensure you have set the environment variables:
- `INPUT_AUTH_TYPE` : `app` or `token`
- `INPUT_APP_ID` and `INPUT_APP_BASE64_PRIVATE_KEY`: The app id and app ssh key.
- `INPUT_ORG`: The org in which the app is installed.**Example:**
```bash
export INPUT_ORG=philips-software
export INPUT_APP_ID=1234
export INPUT_AUTH_TYPE=installation
export INPUT_APP_BASE64_PRIVATE_KEY=$(cat my.pem | base64)
yarn watch
```## Contribution
We welcome contributions, please checkout the [contribution guide](CONTRIBUTING.md).
## License
This project are released under the [MIT License](./LICENSE).
## Philips Forest
This module is part of the Philips Forest.
```
___ _
/ __\__ _ __ ___ ___| |_
/ _\/ _ \| '__/ _ \/ __| __|
/ / | (_) | | | __/\__ \ |_
\/ \___/|_| \___||___/\__|CI
```