@@ -3,26 +3,26 @@ export PRIVATE_KEY=${1:?Usage: ${0} <private-key> <app-id>}
3
3
export APP_ID=${2:? Usage: ${0} <private-key> <app-id>}
4
4
repo=${GITHUB_REPOSITORY:? Missing required GITHUB_REPOSITORY environment variable}
5
5
6
- [[ ! -z " $INPUT_REPO " ]] && repo=$INPUT_REPO
6
+ [ -n " $INPUT_REPO " ] && repo=" $INPUT_REPO "
7
7
8
- jwt=$( ruby $( dirname $0 ) /generate_jwt.rb)
9
- response=$( curl -s -H " Authorization: Bearer ${jwt} " -H " Accept: application/vnd.github.v3+json" https://api.github.com/repos/${repo} /installation)
10
- installation_id=$( echo $response | jq -r .id)
8
+ jwt=$( ruby " $( dirname " $0 " ) " /generate_jwt.rb)
9
+ response=$( curl -s -H " Authorization: Bearer ${jwt} " -H " Accept: application/vnd.github.v3+json" " https://api.github.com/repos/${repo} /installation" )
10
+ installation_id=$( echo " $response " | jq -r .id)
11
11
12
12
if [ " $installation_id " = " null" ]; then
13
13
echo " Unable to get installation ID. Is the GitHub App installed on ${repo} ?"
14
- echo $( echo $ response | jq -r .message)
14
+ echo " $ response" | jq -r .message
15
15
exit 1
16
16
fi
17
17
18
18
token=$( curl -s -X POST \
19
- -H " Authorization: Bearer ${jwt} " \
20
- -H " Accept: application/vnd.github.v3+json" \
21
- https://api.github.com/app/installations/${installation_id} /access_tokens | jq -r .token)
19
+ -H " Authorization: Bearer ${jwt} " \
20
+ -H " Accept: application/vnd.github.v3+json" \
21
+ https://api.github.com/app/installations/" ${installation_id} " /access_tokens | jq -r .token)
22
22
23
23
if [ " $token " = " null" ]; then
24
- echo " Unable to generate installation access token"
25
- exit 1
24
+ echo " Unable to generate installation access token"
25
+ exit 1
26
26
fi
27
27
28
- echo ::set-output name=token::${token}
28
+ echo " ::set-output name=token::${token} "
0 commit comments