File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ inputs:
14
14
description : ' Optional nancy command. Defaults to "sleuth"'
15
15
required : false
16
16
default : ' sleuth'
17
+ githubToken :
18
+ description : ' Optional GitHub token. If not provided, no GitHub token will be used.'
19
+ required : false
20
+ default : ' '
17
21
runs :
18
22
using : ' docker'
19
23
image : ' Dockerfile'
Original file line number Diff line number Diff line change 14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
+ acurl () {
18
+ curl " $@ "
19
+ }
20
+ if [ -n " ${INPUT_GITHUBTOKEN} " ]; then
21
+ acurl () {
22
+ echo " using authenticated curl"
23
+ curl -H " Authorization: Bearer ${INPUT_GITHUBTOKEN} " " $@ "
24
+ }
25
+ fi
26
+
17
27
desiredVersion=" $1 "
18
28
echo " desired nancy version: ${desiredVersion} "
19
29
if [ -z " $desiredVersion " ]; then
20
30
>&2 echo " must specify a desiredVersion, like: latest or v1.0.15"
21
31
exit 1
22
32
elif [[ ${desiredVersion} == " latest" ]]; then
23
- latest_version_is=$( curl --fail -s https://api.github.com/repos/sonatype-nexus-community/nancy/releases/latest | grep -oP ' "tag_name": "\K(.*)(?=")' )
33
+ latest_version_is=$( acurl --fail -s https://api.github.com/repos/sonatype-nexus-community/nancy/releases/latest | grep -oP ' "tag_name": "\K(.*)(?=")' )
24
34
desiredVersion=${latest_version_is}
25
35
elif [[ ${desiredVersion: 0: 1} != " v" ]]; then
26
36
>&2 echo " specific nancy version (${desiredVersion} ) must start with v, like: v1.0.15"
29
39
# installer filename excludes v from version
30
40
sourceUrl=" https://github.com/sonatype-nexus-community/nancy/releases/download/${desiredVersion} /nancy_${desiredVersion: 1} _linux_amd64.apk"
31
41
echo " installing nancy via ${sourceUrl} "
32
- curl --fail -L -o nancy.apk ${sourceUrl}
42
+ acurl --fail -L -o nancy.apk " ${sourceUrl} "
33
43
apk add --no-progress --quiet --no-cache --allow-untrusted nancy.apk
You can’t perform that action at this time.
0 commit comments