generated from blackbird-cloud/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 870 Bytes
/
format.yml
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
name: Validate and Format
on:
pull_request:
branches:
- main
jobs:
format:
if: github.event.pull_request.state == 'open'
runs-on: ubuntu-latest
container: blackbirdcloud/terraform-toolkit:latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Configure git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Validate and Format
env:
TFENV_TERRAFORM_VERSION: latest-allowed
run: |
terraform init -backend=false
terraform validate
terraform fmt
- name: Commit and push
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions