Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/actions/build/deploy-java/push-to-central.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ function cleanup() {
# Run the cleanup on failure / exit
trap cleanup EXIT

export GPG_TTY=$(tty)
# tty fails without a terminal (as on CI); that must not stop the script
GPG_TTY=$(tty) || true
export GPG_TTY
echo $GPG_SIGNING_KEY | base64 -d > signing.gpg
gpg --batch --import signing.gpg

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build/load-containers/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ runs:
shell: bash
if: ${{ contains(inputs.registry, 'minikube') }}
run: |
eval $(minikube docker-env)
eval "$(minikube docker-env)"
make docker_load docker_e2e docker_delete_archive
env:
DOCKER_ARCHITECTURE: ${{ inputs.architecture }}
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/dependencies/setup-kind/setup-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function load_iptables_modules_for_podman {
4) registry_dns - DNS name for registry
@global:
IP_FAMILY - Determines whether to configure IPv4 or IPv6 settings
@note: Adjusts the container runtime’s config files (/etc/docker/daemon.json
@note: Adjusts the container runtime config files (/etc/docker/daemon.json
or /etc/containers/registries.conf) and restarts the respective service.
'
function updateContainerRuntimeConfiguration {
Expand Down Expand Up @@ -174,7 +174,7 @@ EOF
sudo systemctl restart docker
else
# Ensure the podman_config is inserted correctly after unqualified-search-registries
sudo awk -v config="$podman_config" '
awk -v config="$podman_config" '
BEGIN { inserted = 0 }
/unqualified-search-registries/ && !inserted {
print $0
Expand Down Expand Up @@ -238,12 +238,12 @@ nodes:
EOF

# Add control-plane nodes
for i in $(seq 1 "$control_planes"); do
for _ in $(seq 1 "$control_planes"); do
echo " - role: control-plane" >> /tmp/kind-config.yaml
done

# Add worker nodes
for i in $(seq 1 "$worker_nodes"); do
for _ in $(seq 1 "$worker_nodes"); do
echo " - role: worker" >> /tmp/kind-config.yaml
done

Expand Down
2 changes: 1 addition & 1 deletion .github/tests/setup-nexus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ echo ">>> Waiting for Nexus to fully initialize..."
sleep 10

echo ">>> Retrieving admin password..."
NEXUS_PASSWORD=$(docker exec $(docker ps -q --filter ancestor=$NEXUS_IMAGE) cat /nexus-data/admin.password 2>/dev/null)
NEXUS_PASSWORD=$(docker exec "$(docker ps -q --filter ancestor="$NEXUS_IMAGE")" cat /nexus-data/admin.password 2>/dev/null)

if [ -z "$NEXUS_PASSWORD" ]; then
echo "ERROR: Could not retrieve Nexus admin password"
Expand Down
24 changes: 24 additions & 0 deletions .github/tests/shellcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Runs ShellCheck on all shell scripts and on the run: steps of composite actions.
# actionlint covers run: steps in workflows only, so composite actions need this.
set -euo pipefail
cd "$(git rev-parse --show-toplevel)"

status=0

find .github -name '*.sh' -print0 | xargs -0 shellcheck -S warning || status=1

for action in .github/actions/*/*/action.yml; do
steps=$(yq '.runs.steps | length' "$action")
for ((i = 0; i < steps; i++)); do
[ "$(yq ".runs.steps[$i] | has(\"run\")" "$action")" = "true" ] || continue
# Expressions are evaluated before the shell runs, so replace them like actionlint does
if ! out=$( { echo '#!/bin/bash'; yq ".runs.steps[$i].run" "$action" | sed -E 's/\$\{\{[^}]*\}\}/_expr_/g'; } | shellcheck -S warning -e SC2050,SC2154,SC2157,SC2194 -); then
echo "${action}: step '$(yq ".runs.steps[$i].name" "$action")'"
echo "$out"
status=1
fi
done
done

exit $status
9 changes: 9 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@ jobs:
- uses: docker://rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667 # v1.7.12
with:
args: -color

shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/dependencies/install-shellcheck
- uses: ./.github/actions/dependencies/install-yq
- name: Run ShellCheck on scripts and composite actions
run: .github/tests/shellcheck.sh
Loading