Skip to content

Commit

Permalink
Add actionlint feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jgarber623-cargosense committed Feb 28, 2024
1 parent 857ea55 commit 04bbe39
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/actionlint/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "actionlint",
"id": "actionlint",
"version": "1.0.0",
"options": {
"version": {
"type": "string",
"proposals": [
"latest"
],
"default": "latest",
"description": "Select or enter an actionlint version."
},
"installPath": {
"type": "string",
"default": "/usr/local/bin",
"description": "The path where actionlint will be installed."
}
},
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
]
}
27 changes: 27 additions & 0 deletions src/actionlint/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env sh

set -e

ACTIONLINT_VERSION="${VERSION:-"latest"}"
INSTALL_PATH="${INSTALLPATH:-"/usr/local/bin"}"

if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi

curl_installed=""

if ! [ type curl >/dev/null 2>&1 ]; then
apt update --yes
apt install --no-install-recommends --yes curl ca-certificates

curl_installed="true"
fi

curl -sSL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash | \
/bin/bash -s -- "${ACTIONLINT_VERSION}" "${INSTALL_PATH}"

if ! [ -z $curl_installed ]; then
apt purge curl --autoremove --yes
fi

0 comments on commit 04bbe39

Please sign in to comment.