forked from nabeken/go-github-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
39 lines (35 loc) · 1.2 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
32
33
34
35
36
37
38
39
inputs:
version:
description: "A version to install"
default: "0.1.7"
installation_id:
description: "Github Apps Installation ID"
app_id:
description: "Github Apps App ID"
private_key:
description: "Github Apps Private Key"
github_url:
description: "Github API URL, for use with Github Enterprise"
default: "https://api.github.com"
outputs:
app_github_token:
description: "GITHUB_TOKEN for your Github Apps"
value: ${{ steps.go-github-apps.outputs.github_token }}
runs:
using: "composite"
steps:
- run: |
curl -sSLf https://raw.githubusercontent.com/peakon/go-github-apps/master/install-via-release.sh | bash -s -- -v v${{ inputs.version }}
sudo cp go-github-apps /usr/local/bin
shell: bash
- id: go-github-apps
run: |
T=$(mktemp)
trap "rm -f $T" 1 2 3 15
urlparam=""
if [ -n "${{ inputs.github_url }}" ]; then
urlparam="-url ${{ inputs.github_url }}"
fi
env GITHUB_PRIV_KEY="${{ inputs.private_key }}" go-github-apps -inst-id ${{ inputs.installation_id }} -app-id ${{ inputs.app_id }} $urlparam > $T
echo "github_token=$(cat $T)" >> $GITHUB_OUTPUT
shell: bash