Skip to content

feat(release): v1.3.0+ から Cask 自動更新を有効化#192

Merged
shomatan merged 1 commit into
mainfrom
chore/auto-update-cask
May 13, 2026
Merged

feat(release): v1.3.0+ から Cask 自動更新を有効化#192
shomatan merged 1 commit into
mainfrom
chore/auto-update-cask

Conversation

@shomatan
Copy link
Copy Markdown
Collaborator

概要

release.ymlupdate-cask ジョブを追加し、v1.3.0 以降のタグ push で
ignission/homebrew-tapCasks/ark.rb を自動的に bump する。

v1.2.0 までは手動で Cask を投入済み (ignission/homebrew-tap#1)。
本 PR で v1.3.0 以降の自動化が有効になる。

変更点

build ジョブ

  • outputs.sha256 / outputs.zip_basename を露出
  • SHASHA256, BASENAMEZIP_BASENAME に命名統一 (codex [低] 反映)

update-cask ジョブ (新規)

  • needs: build、tag (refs/tags/v*) push または workflow_dispatch + inputs.tag 指定時のみ起動
  • HOMEBREW_TAP_TOKEN secret 未設定なら無害に skip (release 自体は失敗させない)
  • 設定済みなら ignission/homebrew-tapmain を checkout → Casks/ark.rb の version + sha256 を sed で更新 → main に直接 commit
  • non-fast-forward push 失敗時のみ pull --rebase + 最大 3 回 retry

防御策 (codex review の段階反映)

  • TAG の形式 (^v[0-9]+\.[0-9]+\.[0-9]+$) と SHA256 の形式 (64 hex) を検証して sed 注入を防止
  • zip basename と Cask の url パターン (Ark-#{version}-arm64-mac.zip) の整合を検証
  • 置換前後で「version 行 / sha256 行 / url パターンが各 1 件」を fixed-string で assert (multi-arch 化時の誤更新防止)
  • downgrade を sort -V -C で拒否
  • pull --rebase 後に Cask invariant を共通関数で再検証
  • push 失敗ログから non-fast-forward 系のみ retry 対象に分離 (認可不備等は即 abort)
  • Cask 内容のログ出力は関連行 (^ (version|sha256|url)) のみ (tap が private の場合の流出防止)

前提 (マージ前の手動セットアップ)

ignission/claude-code-arkSettings → Secrets and variables → Actions
HOMEBREW_TAP_TOKEN を追加:

  • ignission/homebrew-tap への contents: write 権限を持つ fine-grained PAT
  • または同等の GitHub App token

secret 未設定でも release 自体は壊れない設計だが、設定しないと Cask 自動更新は永続的に skip される。

動作確認

v1.3.0 タグ push 時に release.yml の update-cask ジョブが走り、
homebrew-tap の Casks/ark.rb が自動で新しい version + sha256 に書き換わることを確認する。

関連

release.yml に update-cask ジョブを追加:
- build ジョブから sha256 / zip_basename を outputs として露出
- HOMEBREW_TAP_TOKEN secret 未設定なら無害に skip
- 設定済みなら ignission/homebrew-tap を clone し
  Casks/ark.rb の version + sha256 を sed で更新、main に直接 commit
- tag (v<X.Y.Z>) と sha256 (64 hex) の形式を検証して sed 注入を防ぐ
- zip basename が Cask の url パターン (Ark-<version>-arm64-mac.zip) と
  整合しているかを assertion で確認

v1.2.0 までは手動 PR で Cask 投入済み (ignission/homebrew-tap#1)。
v1.3.0 から本ジョブが自動で Cask を bump する。
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@shomatan has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 39 minutes and 32 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b29775ce-bd6e-4f79-86d3-b7d5e44b0211

📥 Commits

Reviewing files that changed from the base of the PR and between 2bc38bd and 73ff618.

📒 Files selected for processing (1)
  • .github/workflows/release.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/auto-update-cask

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 and usage tips.

@shomatan shomatan merged commit 9c07124 into main May 13, 2026
2 checks passed
@shomatan shomatan deleted the chore/auto-update-cask branch May 13, 2026 04:40
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