mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-09 02:23:39 -05:00
15 lines
585 B
Bash
15 lines
585 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -euo pipefail
|
||
|
|
||
|
url=$(curl -s \
|
||
|
-H "Accept: application/vnd.github+json" \
|
||
|
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||
|
"https://api.github.com/repos/checkstyle/checkstyle/releases/tags/checkstyle-${CHECKSTYLE_VERSION}" |
|
||
|
jq --arg name "checkstyle-${CHECKSTYLE_VERSION}-all.jar" -r '.assets | .[] | select(.name==$name) | .url')
|
||
|
curl --retry 5 --retry-delay 5 -sL -o /usr/bin/checkstyle \
|
||
|
-H "Accept: application/octet-stream" \
|
||
|
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||
|
"${url}"
|
||
|
chmod a+x /usr/bin/checkstyle
|