This repository has been archived by the owner on May 21, 2024. It is now read-only.
Add XKS label to workflows #137
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: check | |
on: [pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@master | |
- name: Setup TFLint | |
uses: terraform-linters/setup-tflint@v2 | |
with: | |
tflint_version: v0.42.1 | |
- name: Run lint | |
run: | | |
make lint | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@master | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v2 | |
with: | |
terraform_version: 1.3.0 | |
- name: Run fmt | |
run: | | |
sudo apt-get install parallel | |
make fmt | |
- name: Check if working tree is dirty | |
run: | | |
if [[ $(git status --porcelain) ]]; then | |
git diff | |
echo 'run make fmt and commit changes' | |
exit 1 | |
fi | |
tfsec: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@master | |
- name: Setup tfsec | |
env: | |
TFSEC_VERSION: "v1.27.1" | |
TFSEC_SHA: "edf06ce4897a3113dda6393b31345aea8b70626dac4c67df87ef0b69fd6c83f0" | |
run: | | |
wget https://github.com/tfsec/tfsec/releases/download/${TFSEC_VERSION}/tfsec-linux-amd64 | |
DOWNLOAD_TFSEC_SHA=$(openssl sha1 -sha256 tfsec-linux-amd64 | awk '{print $2}') | |
if [[ "${TFSEC_SHA}" != "${DOWNLOAD_TFSEC_SHA}" ]]; then | |
echo "Downloaded checksum (${DOWNLOAD_TFSEC_SHA}) for tfsec does not match expected value: ${TFSEC_SHA}" | |
exit 1 | |
fi | |
chmod +x tfsec-linux-amd64 | |
mkdir -p ~/.local/bin/ | |
mv ./tfsec-linux-amd64 ~/.local/bin/tfsec | |
- name: Run tfsec | |
run: | | |
export PATH=${PATH}:~/.local/bin | |
make tfsec | |
validate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@master | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v2 | |
with: | |
terraform_version: 1.3.0 | |
- name: Run terraform validate | |
run: | | |
sudo apt-get install parallel | |
make validate |