Skip to content

chore(deps): update dependency myst-parser to v5 #907

chore(deps): update dependency myst-parser to v5

chore(deps): update dependency myst-parser to v5 #907

# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
name: Terraform lint test (webhook-gateway)
on:
pull_request:
permissions:
contents: read
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
terraform: ${{ steps.filter.outputs.terraform }}
steps:
- uses: actions/checkout@v6.0.2
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
terraform:
- "**/terraform/**"
validate:
needs: detect-changes
if: needs.detect-changes.outputs.terraform == 'true'
name: Validate terraform configuration files
runs-on: ubuntu-latest
env:
WORKING_DIR: "charms/webhook-gateway-operator/terraform"
steps:
- name: Check out code
uses: actions/checkout@v6.0.2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v4.0.0
- name: Run terraform fmt
run: terraform fmt -check -recursive
working-directory: ${{env.WORKING_DIR}}
- name: Setup Tflint
uses: terraform-linters/setup-tflint@v6.2.2
with:
tflint_wrapper_enabled: true
- name: Run tflint
run: |
tflint --version
tflint --init
tflint -f compact --recursive
working-directory: ${{env.WORKING_DIR}}
terraform-lint-status-check:
runs-on: ubuntu-latest
needs: [detect-changes, validate]
if: always()
steps:
- name: Check terraform lint results
run: |
# If linting was skipped because no changes, that's success
if [ "${{ needs.detect-changes.outputs.terraform }}" != "true" ]; then
echo "No terraform changes detected, skipping lint is expected"
exit 0
fi
# If lint ran, check its results
validate_result="${{ needs.validate.result }}"
echo "Terraform lint result: $validate_result"
# Fail if lint that ran actually failed (not skipped)
if [ "$validate_result" = "failure" ]; then
echo "Terraform lint failed"
exit 1
fi
echo "Terraform lint passed or was skipped appropriately"
exit 0