Skip to content

Update query condition #11

Update query condition

Update query condition #11

Workflow file for this run

name: Tofu
on:
push:
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
branches:
- 'master'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
jobs:
determine-changed-modules:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v47
with:
dir_names: true
dir_names_max_depth: 2
dir_names_exclude_current_dir: true
files: "./modules/**"
matrix: true
- name: 'Set output in the matrix format'
id: set-output
run: echo "changed_directories=${{ steps.changed-files.outputs.all_changed_files }}" >> "$GITHUB_OUTPUT"
check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
strategy:
matrix:
dir: "${{fromJson(needs.determine-changed-modules.outputs.matrix)}}"
needs:
- determine-changed-modules
steps:
- uses: actions/checkout@v6
- uses: opentofu/setup-opentofu@v1
- name: Check module ${{ matrix.dir }}
working-directory: ${{ matrix.dir }}
run: |
echo "::notice::Check fmt"
tofu fmt -check
echo "::notice::Init module"
tofu init
echo "::notice::Validate module"
tofu validate -no-color