Auto-generate the Terraform module READMEs in CI, matching incubator
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github-actions
- Lĩnh vực
- ci-cd, devops, documentation, infrastructure
Hướng nghiên cứu
Start by comparing .github/workflows/terraform-plan.yaml with incubator’s workflow, then inspect the listed Terraform README and .terraform.docs.yml files. Search CONTRIBUTING.md and .github/ISSUE_TEMPLATE/pre-work-template-devops-security.md for the documented manual commands, and verify the repository squash-merge settings with the provided gh commands. Done means the workflow, documentation, cleanup, merge behavior, and later PR validation match the issue’s checks.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Overview
We need devops-security to regenerate its Terraform module READMEs automatically on every pull request, the same way incubator already does, because today they are only updated when someone remembers to run terraform-docs by hand.
Action Items
- Before anything merges, have a repo admin change devops-security's squash-merge message source. devops-security currently squashes with
COMMIT_OR_PR_TITLE/COMMIT_MESSAGES, which copies every branch commit message into the squash commit onmain. The docs job's commit message ends in[skip ci], and GitHub skips every workflow for a push whose commit message contains that string anywhere — so the merge would silently never runApply Terraform changes on merge, with no failed run to notice. This exact failure happened on incubator (hackforla/incubator#179) and was fixed there by switching to the PR title and body. Run (needs admin on the repo):
gh api -X PATCH repos/hackforla/devops-security -f squash_merge_commit_title='PR_TITLE' -f squash_merge_commit_message='PR_BODY'
and confirm withgh api repos/hackforla/devops-security -q '[.squash_merge_commit_title,.squash_merge_commit_message]', which should print["PR_TITLE","PR_BODY"]. - Add a
terraform-docsjob to.github/workflows/terraform-plan.yaml, copied verbatim from theterraform-docsjob in incubator's.github/workflows/terraform-plan.yaml— same action and version (terraform-docs/[email protected]), samefind-dir: "terraform",output-file: README.md,output-method: inject,git-push: "true", same commit message including[skip ci]and its comment, same job-levelpermissions(contents: write,pull-requests: write), and the sameactions/checkoutstep withref: ${{ github.event.pull_request.head.ref }}. Keep the checkout version identical to incubator's too; bumping it is hackforla/devops#183's job for both repos. - Delete the five hand-run config files:
terraform/.terraform.docs.ymlandterraform/modules/{aws-groups,aws-policies,aws-roles,aws-users}/.terraform.docs.yml. Why: incubator's job runs with no config, so these would be ignored anyway (terraform-docs only auto-discovers a file named exactly.terraform-docs.yml, with a hyphen — these use a dot). Leaving them would tell contributors a config is in effect when it is not. - Move each README's hand-written prose above its
<!-- BEGIN_TF_DOCS -->marker. Why: those configs usedmode: replacewith a customcontent:template, so every README today starts with the marker and the hand-written parts — the# Overview/# Groups/# Usersetc. headings, the one-line module descriptions, and the root README's "Directory Structure" list — sit inside the generated block. Inject mode overwrites everything between the markers, so without this step the first run deletes them. Text above the marker survives regeneration; this is how incubator'sterraform/modules/legacy/README.mdkeeps its prose. Drop the "To automatically update this documentation, install terraform-docs…" paragraph rather than moving it — it will no longer be true. - Update
CONTRIBUTING.mdso it no longer tells contributors to runterraform-docs -c .terraform.docs.yml .by hand: the "Installing Terraform docs" section (around line 185) and the command around line 311. Say instead that CI regenerates the READMEs and pushes a commit to the PR branch, so contributors shouldgit pullbefore pushing again. - Update
.github/ISSUE_TEMPLATE/pre-work-template-devops-security.mdto match: the "Install Terraform Docs locally" item (around line 42) and theterraform-docs -c .terraform.docs.yml .item (around line 84). - Open the PR. The new job will run on it and push a
terraform-docs: automated updates…commit back to your branch — that commit is the job working, not something to revert. Read its diff: it should change only content between the markers. Expectterraform/modules/aws-gha-oidc-providers/, which has no README today, to get a new one. - After the PR merges, confirm the
mainsquash commit message does not contain[skip ci]and thatApply Terraform changes on mergeran for it (gh run list -R hackforla/devops-security -w "Apply Terraform changes on merge" -L 3). If no run exists for the merge commit, the first action item did not take effect. - After the PR merges, open any later PR that touches a
.tffile (or a throwaway one) and confirm theGenerate Terraform Docsjob runs and either pushes a docs commit or finishes with nothing to change.
Resources/Instructions
- Reference job: incubator
.github/workflows/terraform-plan.yaml— theterraform-docs:job at the bottom of the file - File to change: devops-security
.github/workflows/terraform-plan.yaml - Configs to delete: terraform/.terraform.docs.yml and the one in each of terraform/modules/
- CONTRIBUTING.md — search for "Installing Terraform docs" and for
.terraform.docs.yml - pre-work template — search for "terraform-docs"
- Prior art: hackforla/incubator#66 (automating terraform-docs in incubator); hackforla/incubator#179 (the merge whose apply was silently skipped by
[skip ci]) - terraform-docs/gh-actions — action inputs reference
- Line numbers were accurate when this was written (2026-10-03) and may drift; use the search text given next to each one.
- Ngôn ngữ chính
- TypeScript
- Star
- 1
- Fork
- 14
- Merge trung bình
- 3 giờ 36 phút
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của hackforla/devops-security
-
complexity: small feature: security role: DevOps Engineer size: 2pt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
hackforla/devops-security#203 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
complexity: small feature: security good first issue role: DevOps Engineer size: 0.5pt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
hackforla/devops-security#202 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bump configure-aws-credentials to v6 and dflook/terraform-* to v3 in the Terraform workflowsĐang mởcomplexity: medium feature: maintenance role: DevOps Engineer size: 2pt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
hackforla/devops-security#170 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
New user for mike waggonerCó thể đã có người làm @here đã nhận 7 ngày trước. Đang mởcomplexity: small feature: AWS user request role: DevOps Engineer size: 1pt
hackforla/devops-security#205 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Pre-work Checklist: DevOps-Security-Member: here mike waggonerCó thể đã có người làm @here đã nhận 7 ngày trước. Đang mởcomplexity: prework Feature: Onboarding/Contributing.md role: DevOps Engineer size: 1pt
hackforla/devops-security#204 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của hackforla/devops-security
Issue tương tự
-
bug DUP Reservations
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
bcgov/reserve-rec-public#952 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
daufderheide/racecoordinator_ai#948 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug pulumi/pulumi
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug priority:high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
api bug claude
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
diegosouzapw/OmniRoute#15764 ·
Maintainer thường phản hồi trong vòng 2 ngày