Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4 #89

Draft
wants to merge 18 commits into
base: v2
Choose a base branch
from
Draft

V4 #89

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
39 changes: 20 additions & 19 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ on:
description: Enforce tflint warnings for changed files by default
type: boolean
default: false
default_runner_override_label:
description: Change this to "self-hosted" or "ubuntu-latest"
type: string
default: "ubuntu-latest"
runner_label:
description: Runner label to point to self hosted runners
type: string
Expand All @@ -101,9 +97,11 @@ jobs:
if: github.ref_name != 'main'
name: Format and Validate
runs-on:
- ${{ inputs.default_runner_override_label }}
- ${{ inputs.runner_label }}
steps:
- name: Install missing binaries zip jq curl
run: sudo apt-get update && sudo apt-get install zip jq curl git -y

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -114,6 +112,11 @@ jobs:
with:
python-version: '3.11'

- name: Setup Node only for self-hosted runners
uses: actions/setup-node@v3
with:
node-version: 19

- run: mkdir -p "${TF_PLUGIN_CACHE_DIR}"
- name: Cache Terraform
uses: actions/cache@v4
Expand All @@ -126,12 +129,6 @@ jobs:
path: ~/.tflint.d/plugins
key: ${{ runner.os }}-tflint-${{ hashFiles('**/.tflint.hcl') }}

- name: Setup Node only for self-hosted runners
uses: actions/setup-node@v4
if: ${{ inputs.default_runner_override_label == 'self-hosted' }}
with:
node-version: 18

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
Expand Down Expand Up @@ -199,9 +196,11 @@ jobs:
name: Linting
if: github.ref_name != 'main'
runs-on:
- ${{ inputs.default_runner_override_label }}
- ${{ inputs.runner_label }}
steps:
- name: Install missing binaries zip jq curl
run: sudo apt-get update && sudo apt-get install zip jq curl git -y

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -212,6 +211,11 @@ jobs:
with:
python-version: '3.11'

- name: Setup Node only for self-hosted runners
uses: actions/setup-node@v3
with:
node-version: 19

- run: mkdir -p "${TF_PLUGIN_CACHE_DIR}"
- name: Cache Terraform
uses: actions/cache@v4
Expand Down Expand Up @@ -242,12 +246,6 @@ jobs:
tflint_version: "v0.51.1"
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node only for self-hosted runners
uses: actions/setup-node@v4
if: ${{ inputs.default_runner_override_label == 'self-hosted' }}
with:
node-version: 19

- name: Pre-init Hook
run: ${{ inputs.pre_init_hook }}

Expand Down Expand Up @@ -327,7 +325,6 @@ jobs:
name: Security Checks
if: github.ref_name != 'main'
runs-on:
- ${{ inputs.default_runner_override_label }}
- ${{ inputs.runner_label }}
steps:
- name: Checkout
Expand All @@ -336,6 +333,10 @@ jobs:
fetch-depth: 1
submodules: ${{ inputs.enable_submodules }}

# - name: Build an image from Dockerfile
# run: |
# docker build -t docker.io/my-organization/my-app:${{ github.sha }} . --network host

- name: Run Trivy vulnerability scanner in IaC mode
uses: aquasecurity/[email protected]
with:
Expand Down
Loading