-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaction.yml
52 lines (47 loc) · 1.68 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
40
41
42
43
44
45
46
47
48
49
50
51
52
inputs:
version:
description: "A version to install"
# renovate: datasource=github-releases depName=nabeken/go-github-apps
default: "0.2.2"
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:
- name: The Github Actions will be obsoleted in the future
shell: bash
run: |
echo "::warning:: go-github-apps's Github Actions will be obsoleted in the future. Please see README about the migration to Github's official one." >&2
- run: |
curl -sSLf https://raw.githubusercontent.com/nabeken/go-github-apps/master/install-via-release.sh | bash -s -- -v "${VERSION}"
sudo cp go-github-apps /usr/local/bin
shell: bash
env:
VERSION: "v${{ inputs.version }}"
- id: go-github-apps
run: |
T=$(mktemp)
trap "rm -f $T" 1 2 3 15
urlparam=""
if [ -n "${GITHUB_URL}" ]; then
urlparam="-url ${GITHUB_URL}"
fi
go-github-apps -app-id "${GH_APP_ID}" -inst-id "${GH_APP_INST_ID}" $urlparam > $T
echo "github_token=$(cat $T)" >> $GITHUB_OUTPUT
shell: bash
env:
GITHUB_URL: "${{ inputs.github_url }}"
GITHUB_PRIV_KEY: "${{ inputs.private_key }}"
GH_APP_ID: "${{ inputs.app_id }}"
GH_APP_INST_ID: "${{ inputs.installation_id }}"