-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaction.yml
31 lines (31 loc) · 1.1 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: get-github-app-pat
author: "Nastaliss"
description: "Obtain a GitHub App installation access token to use in place of a PAT from an application private key"
inputs:
app-id:
description: "The ID of the GitHub App"
required: true
app-installation-id:
description: "The installation ID of the GitHub App"
required: true
app-private-key:
description: "The private key of the GitHub App"
required: true
outputs:
access-token:
description: "Access token for the to use in place of a PAT"
value: ${{ steps.generateAccessToken.outputs.access-token }}
runs:
using: "composite"
steps:
- name: Generate Access Token
id: generateAccessToken
run: |
echo "${{ inputs.app-private-key }}" > /tmp/app-private-key.pem
access_token="$(APP_INSTALLATION_ID=${{ inputs.app-installation-id }} \
APP_ID=${{ inputs.app-id }} \
SIGNING_KEY_PATH="/tmp/app-private-key.pem" \
${{ github.action_path }}/generate_github_access_token.sh)"
echo "::add-mask::$access_token"
echo "access-token=$access_token" >> $GITHUB_OUTPUT
shell: bash