asg-server/.github/workflows/terraform-validate.yml
Aleksandr 37730e67c2 Potential fix for code scanning alert no. 9: Workflow does not contain permissions
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-16 20:03:46 +07:00

36 lines
832 B
YAML

name: Terraform Validate
permissions:
contents: read
on:
pull_request:
branches:
- master
paths:
- "**/*.tf"
jobs:
validate:
name: Validate Terraform
runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]'
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.4.6
- name: Initialize Terraform
working-directory: deployments/docker-swarm-terraform
run: terraform init
- name: Validate Terraform
working-directory: deployments/docker-swarm-terraform
run: terraform validate