Skip to content

Commit 9eccd2d

Browse files
committed
- GHO-22: Add tofu fmt check workflow initially targeting feature branch commits
1 parent 5f9763e commit 9eccd2d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Feature branch tofu checks (containerized)
2+
3+
on:
4+
push:
5+
branches:
6+
- "feature/**"
7+
8+
permissions:
9+
contents: read
10+
packages: read
11+
12+
jobs:
13+
tofu-checks:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
# Required if the GHCR image is private
23+
- name: Log in to GHCR
24+
env:
25+
GHCR_TOKEN: ${{ github.token }}
26+
run: |
27+
docker login ghcr.io -u "${{ github.actor }}" --password-stdin <<< "$GHCR_TOKEN"
28+
29+
- name: Pull OpenTofu tools image
30+
run: |
31+
docker pull ghcr.io/noahwhite/ghost-stack-shell:latest
32+
33+
- name: Run tofu fmt check (recursive)
34+
run: |
35+
docker run --rm \
36+
-v "${GITHUB_WORKSPACE}:/home/devops/app" \
37+
-w /home/devops/app \
38+
ghcr.io/noahwhite/ghost-stack-shell:latest \
39+
tofu fmt -check -recursive

0 commit comments

Comments
 (0)