diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml new file mode 100644 index 0000000..4936e10 --- /dev/null +++ b/.github/workflows/pull-request.yaml @@ -0,0 +1,16 @@ +name: Pull Request +on: + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review +jobs: + Static: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Shellcheck + uses: ludeeus/action-shellcheck@master diff --git a/build b/build index f4a25a3..a515319 100755 --- a/build +++ b/build @@ -5,4 +5,7 @@ # # NOTE: must be run from the compenent's root directory. -make images-kind-load VERSION=$(cat charts/$(ls charts)/Chart.yaml | yq .version) +CHART="$(ls charts)" +CHART_META="charts/${CHART}/Chart.yaml" + +make images-kind-load VERSION="$(yq .version "${CHART_META}")" diff --git a/clean-images b/clean-images index b9e08bd..efc2ef3 100755 --- a/clean-images +++ b/clean-images @@ -2,4 +2,5 @@ # Removes any dangling docker images, or which there will be many. -docker rmi $(docker images -f dangling=true | grep -e \^\< | awk '{ print $3; }') +# shellcheck disable=SC2046 +docker rmi $(docker images -f dangling=true | grep -e ^\< | awk '{ print $3; }') diff --git a/deploy b/deploy index 471a152..bc3c1b4 100755 --- a/deploy +++ b/deploy @@ -7,7 +7,7 @@ # NOTE: must be run from the compenent's root directory. # Grab the repository. -REPO=$(basename $(pwd)) +REPO=$(basename "$(pwd)") # Get the environemnt. # TODO: getopts @@ -43,7 +43,7 @@ CRDDIR="${CHARTDIR}/crds" # Update CRDs if necessary, helm won't do this for you. if [[ -d ${CRDDIR} ]]; then - kubectl apply -f ${CRDDIR} + kubectl apply -f "${CRDDIR}" fi ARGS=() @@ -52,8 +52,8 @@ ARGS=() VALUESFILE="${HOME}/.config/unikorn/${ENVIRONMENT}/${REPO}.yaml" if [[ -f ${VALUESFILE} ]]; then - ARGS+=("-f" ${VALUESFILE}) + ARGS+=("-f" "${VALUESFILE}") fi # Deploy the actual chart. -helm upgrade --install --create-namespace -n ${NAMESPACE} ${RELEASE} ${CHARTDIR} ${ARGS[@]} +helm upgrade --install --create-namespace -n ${NAMESPACE} ${RELEASE} "${CHARTDIR}" "${ARGS[@]}" diff --git a/restart b/restart index efc8f04..a48b19d 100755 --- a/restart +++ b/restart @@ -7,7 +7,7 @@ # NOTE: must be run from the compenent's root directory. # Grab the repository. -REPO=$(basename $(pwd)) +REPO=$(basename "$(pwd)") # Do any specializations. case ${REPO} in diff --git a/ui-preview b/ui-preview index db61594..07064dd 100755 --- a/ui-preview +++ b/ui-preview @@ -16,7 +16,8 @@ if [[ ! -f ${ENVFILE} ]]; then fi set -a -source ${ENVFILE} +# shellcheck disable=SC1090 +source "${ENVFILE}" set +a npm run dev