summaryrefslogtreecommitdiff
path: root/.github/workflows/tflint.yaml
blob: 2ba60c43bc23cd39edcbb4149c6e384a9fb6c1b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: tflint

on:
  push:
    branches: [ main ]
    paths:
      - "terraform/**"
      - ".github/workflows/tflint.yaml"
  pull_request:
    paths:
      - "terraform/**"
      - ".github/workflows/tflint.yaml"
  workflow_dispatch:

jobs:
  scan:
    name: Scan

    runs-on: ubuntu-latest

    permissions:
      security-events: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install Nix
        uses: DeterminateSystems/nix-installer-action@v16
        with:
          diagnostic-endpoint: ""

      - name: Build tflint report
        id: tflint-run
        run: |
          echo "sarif-file=$(nix build --no-link --print-build-logs --print-out-paths .#tflint)" >> "$GITHUB_OUTPUT"

      - name: Upload results
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: ${{ steps.tflint-run.outputs.sarif-file }}
          wait-for-processing: true