Skip to content

[SELC-6566] Add products logo (#845) #3215

[SELC-6566] Add products logo (#845)

[SELC-6566] Add products logo (#845) #3215

name: Static Analysis
on:
push:
jobs:
static_analysis:
runs-on: ubuntu-22.04
steps:
# from https://github.com/actions/checkout/commits/main
- uses: actions/checkout@1f9a0c22da41e6ebfa534300ef656657ea2c6707
with:
persist-credentials: false
fetch-depth: 0
- name: init_terraform_folders
env:
FOLDERS: >
src/core
src/core/modules/spid_testenv
src/domains/pnpg-app
src/domains/pnpg-common
src/domains/pnpg-common/modules/spid_testenv
src/k8s
./.identity
run: |
pids=()
TAG=$(cat .terraform-version)
for f in $FOLDERS; do
pushd "$(pwd)/${f}"
if [[ -f "99_main.tf" ]]; then
sed -i -e 's/ backend "azurerm" {}//g' 99_main.tf # use local backend
elif [[ -f "main.tf" ]]; then
sed -i -e 's/ backend "azurerm" {}//g' main.tf # use local backend
fi
docker run -v $(pwd):/tmp -w /tmp hashicorp/terraform:$TAG init &
pids+=($!)
popd
done
# Wait for each specific process to terminate.
# Instead of this loop, a single call to 'wait' would wait for all the jobs
# to terminate, but it would not give us their exit status.
#
for pid in "${pids[@]}"; do
#
# Waiting on a specific PID makes the wait command return with the exit
# status of that process. Because of the 'set -e' setting, any exit status
# other than zero causes the current shell to terminate with that exit
# status as well.
#
wait "$pid"
done
- name: run_pre_commit_terraform
run: |
# from https://github.com/antonbabenko/pre-commit-terraform/pkgs/container/pre-commit-terraform
TAG=v1.94.1@sha256:638e8892cb2647240c175064254c2fda80214597275c81a360a878dc80323076
docker run -v $(pwd):/lint -w /lint ghcr.io/antonbabenko/pre-commit-terraform:$TAG run -a