Skip to content

feat: add the shared workflows, scripts, and renovate preset - #3

Merged
panicboat merged 12 commits into
docs/shared-workflows-designfrom
feat/shared-workflows
Oct 24, 2026
Merged

panicboat merged 12 commits into
docs/shared-workflows-designfrom
feat/shared-workflows

Conversation

@panicboat

Copy link
Copy Markdown
Owner

Summary

monorepo・platform・deploy-actions で重複している workflow と scripts の正本を、このリポジトリに追加します。
各リポジトリはまだ切り替えません(後続の PR で切り替えます)。

Why

同じか酷似した workflow と scripts が複数のリポジトリに並んでいて、片方だけ直し忘れたり、コピー後に中身がずれたりしています。
設計は docs/superpowers/specs/2026-10-25-shared-workflows-design.md、手順は docs/superpowers/plans/2026-10-25-shared-workflows.md にあります。

Before / After

  • 重複していた workflow と scripts の正本
    • Before: monorepo と platform(一部は deploy-actions)にそれぞれある
    • After: このリポジトリの .github/workflows/reusable--*.yaml と scripts/ に 1 つだけある
  • このリポジトリ自身の CI と release
    • Before: なし
    • After: SHA 固定の検査・PR タイトルの検査・gatekeeper・scripts のテストが PR で動き、release-please が vX.Y.Z を付ける

Decisions

  • 共通の workflow どうしは $/.github/workflows/... で呼び、scripts は job.workflow_repository を job.workflow_sha で .shared-workflows/ に checkout して実行します。
    • 呼び出し側が固定した 1 つの SHA で、入れ子の workflow と scripts が揃うためです。
  • 複数の stack をまとめる workflow(resolver と、そこから呼ばれる workflow)は permissions を宣言しません。
    • 呼ばれた側が強い権限を宣言すると、その stack を使わないリポジトリでも起動時に失敗するためです。
  • check-release-configs.sh は、release-please の package と exclude-paths をパスのテンプレートから求めます。
    • monorepo 版は /infrastructure/ を前提にしていて、platform の配置では失敗したためです。
  • render-diff.sh は、隣の scripts を自分の置き場所から探します。
    • .shared-workflows/ から実行されるためです。
  • decide.sh は対象のパスを SCOPE_PATTERN で受け取り、不正な正規表現ではエラーで止まります。
  • 最初の release を v1.0.0 にするため、release-please-config.json に release-as: "1.0.0" を入れています。
    • v1.0.0 の release 後に削除します。
  • Renovate の preset は、3 リポジトリの renovate.json で完全に一致する部分だけを持ちます。

Impact

  • 利用規約
  • プライバシーポリシー
  • ドキュメント

Verification

  • VERIFIED: すべての scripts のテスト(scripts/*/test.sh・scripts/*/*.test.sh・scripts/kubernetes-hydrate/tests/*.test.sh)が手元で exit 0 でした。
  • VERIFIED: check-release-configs.sh と validate-apply-trigger.sh は、monorepo と platform の origin/main の実物に対して exit 0 でした。
  • VERIFIED: renovate@44.181.4 の renovate-config-validator が default.json と .github/renovate.json を通しました。
  • VERIFIED: actionlint のエラーは、actionlint 1.7.12 が知らない $/・job.workflow_*・ubuntu-26.04-arm の行だけでした。
  • この PR の CI で、このリポジトリ自身の check が動くことを確認します。
  • 共通の workflow が別リポジトリから動くことは、platform と monorepo を切り替える PR で確認します。

Relations

🤖 Generated with Claude Code

https://claude.ai/code/session_01R7jQZQj1VyeBbYR7P1ssV7

Move the release scripts that panicboat/monorepo and panicboat/platform each carry into the shared repository.
Base them on the monorepo version, which reads the stack path templates, so both layouts resolve to targets.
Derive the release-please package and exclude-paths from the path template, because cutting working_directory at /infrastructure/ fails on the aws/{service}/{environment} layout.
Reject a terragrunt production environment whose apply_trigger is not release.

Claude-Session: https://claude.ai/code/session_01R7jQZQj1VyeBbYR7P1ssV7
Signed-off-by: panicboat <panicboat@gmail.com>
… scripts

The kubernetes-hydrate scripts and their tests move from platform unchanged.
decide.sh moves from monorepo and takes the paths it watches from SCOPE_PATTERN, which is required.
find-configs.sh lists the directories that hold a release-please-config.json, so a workflow can build a matrix from it.
test-scripts.yaml runs every script test on pull requests and on pushes to main.
aqua.yaml pins the yq and kustomize that the kubernetes-hydrate tests run against.

Claude-Session: https://claude.ai/code/session_01R7jQZQj1VyeBbYR7P1ssV7
Signed-off-by: panicboat <panicboat@gmail.com>
render-diff.sh looked for hydrate-component.sh and summarize-manifest-diff.sh under the caller's .github/scripts/kubernetes-hydrate.
Shared workflows run it from .shared-workflows/scripts/kubernetes-hydrate, where the caller's checkout has no such directory, so every component reported a render failure while the script exited 0.
It now takes them from its own directory and reads the caller's files from the working directory.
The test no longer copies the scripts into the fixture repository, so it fails when the sibling lookup depends on the caller's checkout.

Claude-Session: https://claude.ai/code/session_01R7jQZQj1VyeBbYR7P1ssV7
Signed-off-by: panicboat <panicboat@gmail.com>
grep exits 2 for an invalid pattern, and the negated condition treated that as no match.
decide.sh then answered skip-unchanged, so a broken pattern silently skipped the docs check.
It now exits 1 with an error that names SCOPE_PATTERN, and passes the pattern with -e so a leading dash stays part of it.

Claude-Session: https://claude.ai/code/session_01R7jQZQj1VyeBbYR7P1ssV7
Signed-off-by: panicboat <panicboat@gmail.com>
Add reusable workflows for the Actions SHA-pin lint, the semantic pull request title check, the CI gatekeeper and the deploy label dispatcher.
Add this repository's own callers for the first three, so the shared workflows are exercised from the same commit that defines them.

Claude-Session: https://claude.ai/code/session_01R7jQZQj1VyeBbYR7P1ssV7
Signed-off-by: panicboat <panicboat@gmail.com>
monorepo and platform each carried their own label-base-deploy resolver and deploy stacks.
One resolver now serves both, and each repository enables stacks only through its workflow-config.yaml.

Claude-Session: https://claude.ai/code/session_01R7jQZQj1VyeBbYR7P1ssV7
Signed-off-by: panicboat <panicboat@gmail.com>
Callers need one place for the release flow, so the release-please, plan, deploy and build workflows and the terragrunt release config check move here as reusable workflows.
They read the scripts from a checkout of this repository at the workflow's own sha and call the shared terragrunt runner and container builder without a ref.
Callers grant the permissions and own the workflow-level concurrency, so the reusables only declare the per-job permissions the originals had.
The tag comes from github.event.inputs because the inputs context of a reusable workflow holds its own workflow_call inputs.
This repository releases itself with release-please at the root, and workflows/test.sh pins the structure the release and deploy workflows depend on.

Claude-Session: https://claude.ai/code/session_01R7jQZQj1VyeBbYR7P1ssV7
Signed-off-by: panicboat <panicboat@gmail.com>
This repository only allows squash merges, so the feature branch commit that bootstrap-sha pointed at never exists on main.
Main has few commits, so release-please needs no lower bound for its first release.
The tag reads in the deploy and build workflows now say why they take the dispatch input from the event.

Claude-Session: https://claude.ai/code/session_01R7jQZQj1VyeBbYR7P1ssV7
Signed-off-by: panicboat <panicboat@gmail.com>
The three repositories carried the same Renovate settings, so the top-level options and the four package rules they share move here as default.json.
Rules that only some repositories have, such as the OpenTofu tracking and the custom managers, stay in those repositories.
References to this repository skip minimumReleaseAge because the shared workflows are released by us, and a wait would only delay picking up a release.
This repository extends its own preset with local>, which github.com resolves like github>.
The README now describes how the shared workflows are called and how the preset is extended.

Claude-Session: https://claude.ai/code/session_01R7jQZQj1VyeBbYR7P1ssV7
Signed-off-by: panicboat <panicboat@gmail.com>
@panicboat
panicboat added this pull request to stack #4 October 24, 2026 19:18
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e77a5d69-2e12-4b94-b0fb-05198bbe60b5
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The shared workflows call each other with `$/` and run their scripts from a self checkout of `job.workflow_sha`.
No pull request check ran either path, so a regression in them surfaced only in the consuming repositories.
A test workflow chain now calls a reusable workflow through `$/` and asserts that the self checkout is the running commit and can run a script.
A workflow test pins the `$/` call so it cannot silently become `./`.

Claude-Session: https://claude.ai/code/session_01R7jQZQj1VyeBbYR7P1ssV7
Signed-off-by: panicboat <panicboat@gmail.com>
The kubernetes builder checked out `github.head_ref` for every stack, so the kustomize stack diffed the pull request head instead of the default merge commit against the base.
Only the helmfile stack needs the branch head, because its hydrate job commits manifests to the pull request branch first.
The builder now takes a `ref` input (empty uses the event's default ref) and the resolver passes `github.head_ref` from the helmfile job only.
`fetch-depth: 0` is dropped because no step of the builder reads history.

Claude-Session: https://claude.ai/code/session_01R7jQZQj1VyeBbYR7P1ssV7
Signed-off-by: panicboat <panicboat@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant