Repository navigation
refactor(adr-lint): move the step scripts into files checked out at the workflow's own commit - #40
Conversation
…he workflow's own commit The steps Validate adr-dir, Check MADR headings and Check ADR files now live in scripts/adr-lint, which the workflow checks out from job.workflow_repository at job.workflow_sha. The bats tests run the scripts directly. actionlint 1.7.12 does not know these job properties yet, so .github/actionlint.yaml ignores that error. A shell-lint job runs shellcheck and shfmt on the scripts. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
Review summaryThe refactor is faithful. The script bodies match the old inline steps, and the bats tests now run the scripts directly instead of extracting them with awk. I found no correctness or security problems in the scripts themselves. P1
P3
Not verified
Review was read-only. I made no edits. |
… order shfmt in CI had no .editorconfig, so its defaults (tabs, unindented case branches) differed from the scripts. The README now says that adr-dir is validated before any step that uses it, after the two checkouts, and that this repository must stay public. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 828717f19d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…heckout actions/checkout follows an existing symlink at its destination, so a caller repository holding .adr-lint-scripts as a symlink could redirect the checkout. The step removes the path itself (not its target) first. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
Review summary: no findings. I read the diff for correctness, security and test coverage and found nothing that should block the merge.
Two unverified points, neither a finding:
|
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
概要
adr-lint.ymlの長いインライン Bash("Validate adr-dir","Check MADR headings","Check ADR files")をscripts/adr-lint/のスクリプトに移し,bats テストがそれらを awk による抽出なしで直接実行するようにしました.呼び出し側から見た挙動(入力,チェック内容,エラーメッセージ,失敗の順序)は変わりません.furedea/agent-config#293 の一部です.release PR #38(2.0.0)より先に merge する必要があります.
背景
reusable workflow は自分の ref を知れないと考えられていましたが,
jobコンテキストのjob.workflow_repositoryとjob.workflow_shaが,呼び出されたワークフロー自身のリポジトリとコミットを指します.これにより,自己 pin した SHA なしで,ワークフローと同じコミットのスクリプトを checkout できます.変更内容
scripts/adr-lint/{validate_adr_dir,check_madr_headings,check_adr_files}.shを追加(既存ステップの Bash を移したもの).adr-lint.yml:呼び出し側 repository を checkout した後,スクリプトを.adr-lint-scriptsに sparse checkout し,adr-dir検証をその直後(ADR_DIRを使う他のステップより前)に実行.各ステップは 1 行.tests/adr-lint/check_files.bats:スクリプトを直接実行(既存 19 ケースの期待値は同じ).check_madr_headings.batsを追加(偽のnixでmadr-fromの選別と skip を検証).ci.yml:shell-lintジョブ(shellcheck と shfmt)を追加し,all-greenのneedsに追加..github/actionlint.yaml:actionlint 1.7.12 は文書化されているjob.workflow_repositoryとjob.workflow_shaを未定義と報告するため(fix: add documented job workflow context properties rhysd/actionlint#707,#757),adr-lint.ymlに限りそのエラーだけを ignore.actionlint が対応したら削除する.adr-lint.ymlの節を更新.確認
job.workflow_*に値が入るかは,この PR の CI(adr-lint,adr-lint-madr-from)で確認する.🤖 Generated with Claude Code