Documentation available in Portuguese (pt-BR) here.
Action that generates Token to be consumed in interactions via GitHub API.
Useful for organizations that own GitHub App's.
Secret CREDENTIALS_GITHUB_APP_PRIVATE_KEY
on PEM format:
-----BEGIN RSA PRIVATE KEY-----
9999999999999999999999999999999999999999999999999999999999999999
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
....
-----END RSA PRIVATE KEY-----
As much as it doesn't make sense, in case the user wants a "separate flow" to obtain a Token.
The flow would look like the one shown below.
-
Create directory
.github/worfklows
in the root of your project; -
Create file
generate-token-github-app.yaml
with content similar to the following:
name: Generate Token from GitHub App
on:
pull_request:
types: [opened, reopened, synchronize]
branches:
- main
jobs:
generate-token-github-app:
runs-on: ubuntu-latest
steps:
- name: Generate Token from GitHub App
uses: padupe/action-generate-token-github-app@1.1.3
with:
appId: ${{ secrets.CREDENTIALS_GITHUB_APP_ID }}
installationId: ${{ secrets.CREDENTIALS_GITHUB_APP_INSTALLATION_ID }}
privateKey: ${{ secrets.CREDENTIALS_GITHUB_APP_PRIVATE_KEY }}
The most appropriate use (and that makes the most sense), is implementing this action as a step in a flow:
[...]
- name: Generate Token from GitHub App
id: generate-token-github-app
uses: padupe/action-generate-token-github-app@1.1.3
with:
appId: ${{ secrets.CREDENTIALS_GITHUB_APP_ID }}
installationId: ${{ secrets.CREDENTIALS_GITHUB_APP_INSTALLATION_ID }}
privateKey: ${{ secrets.CREDENTIALS_GITHUB_APP_PRIVATE_KEY }}
- name: Content Change Validation
uses: padupe/action-content-change-validation@1.1.4
with:
directoryOrFile: .github/workflows
gitHubToken: ${{ steps.generate-token-github-app.outputs.gitHubToken }}
[...]
gitHubToken
: token to be used in interactions via GitHub API.
Check our CONTRIBUTING guidelines.