go-toolbox/entrypoint.sh
Stanislav N. aka pztrn 6b53431bf1
All checks were successful
Build container / BuildImage (push) Successful in 1m46s
Force golangci-lint cache directory for running as action.
2025-09-11 08:09:23 +05:00

32 lines
707 B
Bash
Executable File

#!/bin/bash
# Entrypoint that handles both GitHub/Gitea actions things and direct commands execution.
CMD=$*
# Just ensure we have PATH defined properly.
PATH="${PATH}:/usr/bin/:/usr/sbin/:/bin/:/usr/local/bin/:/opt/bin/"
# Also make sure that Go's environment variables are set.
export GOCACHE=/home/container/go/build
export GOMODCACHE=/home/container/go/pkg/mod
export GOPATH=/home/container/go
# ...and golangci-lint also!
export GOLANGCI_LINT_CACHE=/home/container/golangci-lint
if [ "${CMD}" == "" ]; then
CMD="${INPUT_COMMAND}"
fi
if [ "${CMD}" == "" ]; then
echo "! No command to run!"
exit 1
fi
echo "----------"
echo "Launching command:"
echo "${CMD}"
echo "----------"
${CMD}