This GitHub Action installs the Octokit libraries and authenticates with GitHub using an App token.
Digdir Platform Team
-
Install dependencies
npm install
-
Package the TypeScript for distribution
npm run bundle
-
Run tests
npm test
-
app-id
:- Description: The ID of the GitHub App.
- Required: true
- Type: string
-
private-key
:- Description: The private key of the GitHub App.
- Required: true
- Type: string
-
installation-id
:- Description: The ID of the installation.
- Required: true
- Type: string
-
repository
:- Description: The repository name. If not provided, it defaults to the current repository.
- Required: false
- Type: string
-
token
:- Description: The authentication token.
- Type: string
name: Authenticate
on:
push:
branches:
- main
jobs:
authenticate:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Generate Token
id: generate-token
uses: felleslosninger/github-actions/github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
installation-id: ${{ secrets.INSTALLATION_ID }}
- name: Use Token
run: echo "Token is ${{ steps.generate-token.outputs.token }}"
This action authenticates with GitHub using the provided GitHub App ID, Private Key, and Installation ID. It then retrieves an authentication token and outputs it for further use.