File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
.github/actions/gradle/download Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -4,14 +4,30 @@ description: "Download latest release"
4
4
inputs :
5
5
token :
6
6
description : " Github token"
7
- required : true
7
+ required : false
8
8
9
9
runs :
10
10
using : " composite"
11
11
steps :
12
12
- name : Get latest release
13
13
run : |
14
- downloadUrl=$(curl -S -H 'authorization: Bearer ${{ inputs.token }}' https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/latest | jq -c '.assets[] | select(.content_type == "application/zip")' | jq -r .browser_download_url | grep -v maven)
15
- curl -s -L -o gradle-enterprise-gradle-build-validation.zip $downloadUrl
14
+ authHeader=""
15
+ if [ ! -z "${{ inputs.token }}" ]; then
16
+ authHeader="--header 'Authorization: Bearer ${{ inputs.token }}'"
17
+ fi
18
+
19
+ # Build Get Latest release data command
20
+ cmdGetLatestReleaseData="curl -s $authHeader https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/latest"
21
+
22
+ # Get latest release download url
23
+ downloadUrl=$($cmdGetLatestReleaseData | jq -c '.assets[] | select(.content_type == "application/zip")' | jq -r .browser_download_url | grep -v maven)
24
+
25
+ # Build Get Latest release command
26
+ cmdGetLatestRelease="curl -s -L $authHeader -o gradle-enterprise-gradle-build-validation.zip $downloadUrl"
27
+
28
+ # Get latest release
29
+ eval "$cmdGetLatestRelease"
30
+
31
+ # Unzip it
16
32
unzip -q -o gradle-enterprise-gradle-build-validation.zip
17
33
shell : bash
You can’t perform that action at this time.
0 commit comments