Skip to content

Commit cd87b08

Browse files
committed
refactor: use tfroot-runner and fetch canonical pre-commit config
1 parent f36649a commit cd87b08

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

.github/workflows/opentofu.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
container:
1515
description: Container image to use
1616
type: string
17-
default: ghcr.io/makeitworkcloud/runner:latest
17+
default: ghcr.io/makeitworkcloud/tfroot-runner:latest
1818
setup-ssh:
1919
description: Whether to setup SSH keys
2020
type: boolean
@@ -56,11 +56,16 @@ jobs:
5656
if: ${{ inputs.setup-ssh }}
5757
run: cp -r /root/.ssh /github/home/
5858

59+
- name: Fetch canonical pre-commit config
60+
run: |
61+
curl -sSL -o .pre-commit-config.yaml \
62+
https://raw.githubusercontent.com/makeitworkcloud/images/main/tfroot-runner/pre-commit-config.yaml
63+
5964
- name: Initialize OpenTofu
6065
run: tofu init -backend=false
6166

6267
- name: Run tests
63-
run: make test
68+
run: pre-commit run -a
6469

6570
plan:
6671
name: OpenTofu Plan

AGENTS.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Agent Instructions
2+
3+
## Repository Purpose
4+
5+
This repository contains reusable GitHub Actions workflows for the `makeitworkcloud` organization.
6+
7+
## Push Access
8+
9+
Agents are authorized to push directly to `main` in this repository.
10+
11+
## Key Workflows
12+
13+
### opentofu.yml
14+
15+
Reusable workflow for OpenTofu/Terraform root module repositories (`tfroot-*`). It:
16+
17+
1. Fetches canonical pre-commit config from `makeitworkcloud/images` repo
18+
2. Runs pre-commit tests using the `tfroot-runner` container image
19+
3. Posts plan output as PR comments
20+
4. Applies on merge to main
21+
22+
**Pre-commit configuration is centralized** in `makeitworkcloud/images/tfroot-runner/pre-commit-config.yaml`. Do not add `.pre-commit-config.yaml` to individual tfroot repos.
23+
24+
## Related Repositories
25+
26+
- `images` - Contains `tfroot-runner` image and canonical pre-commit config
27+
- `tfroot-cloudflare`, `tfroot-libvirt`, `tfroot-github`, `tfroot-aws` - Terraform root module repos that consume this workflow

0 commit comments

Comments
 (0)