2022-12-29 12:56:54 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
url=$(curl -s \
|
|
|
|
-H "Accept: application/vnd.github+json" \
|
2023-01-04 00:41:31 -05:00
|
|
|
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
2022-12-29 12:56:54 -05:00
|
|
|
"https://api.github.com/repos/pinterest/ktlint/releases/tags/${KTLINT_VERSION}" |
|
|
|
|
jq -r '.assets | .[] | select(.name=="ktlint") | .url')
|
|
|
|
curl --retry 5 --retry-delay 5 -sL -o "/usr/bin/ktlint" \
|
|
|
|
-H "Accept: application/octet-stream" \
|
2023-01-04 00:41:31 -05:00
|
|
|
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
2022-12-29 12:56:54 -05:00
|
|
|
"${url}"
|
|
|
|
chmod a+x /usr/bin/ktlint
|
|
|
|
terrascan init
|
|
|
|
cd ~ && touch .chktexrc
|