Skip to content

Commit e1f490b

Browse files
[Github] Add Terraform Formatting Check
This patch adds a terraform formatting check to the llvm zorg CI. This just makes it easier to verify that patches have been formatted before landing which prevents the need for follow up commits to reformat things later. Reviewers: asb, Keenuts, cmtice, lnihlen Reviewed By: cmtice Pull Request: #503
1 parent 8260d6a commit e1f490b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/tf-formatting.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Terraform Formatting Check
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
12+
jobs:
13+
check_formatting:
14+
name: Check Formatting
15+
if: github.repository_owner == 'llvm'
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Install Dependencies
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -y curl
23+
curl https://releases.hashicorp.com/terraform/1.12.2/terraform_1.12.2_linux_amd64.zip > /tmp/tf.zip
24+
cd /tmp
25+
unzip /tmp/tf.zip
26+
cp terraform /usr/local/bin/terraform
27+
- name: Check Formatting
28+
run: |
29+
terraform fmt -recursive -check .

0 commit comments

Comments
 (0)