local-action-verification について
このスキルは、actでGitHub Actionsワークフローをローカル実行するスクリプトと手順をリポジトリに追加します。Julesなどのエージェントがプッシュ前に変更を検証でき、インストーラーとログを監視するバックグラウンド実行スクリプトを備えます。
主な機能
- 01必要に応じたactのインストール
- 02actワークフローのバックグラウンド実行
- 03タイムアウト回避のログ監視
- 04AGENTS.mdへの利用手順追加
- 05CI生成物の除外設定
活用シーン
- 01プッシュ前のローカルCI検証
- 02Jules向け検証フローの設定
- 03失敗ログの確認とワークフロー再実行
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ google-labs-code/ jules-skills --skill local-action-verificationインストール後、Claude Code で/local-action-verificationを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
README.mdresources/troubleshooting.mdscripts/install-act.shrun-act.sh詳細
act によるローカルアクションの検証
Jules(または任意のエージェント)が act を使って GitHub Actions ワークフローをローカルで実行し、コードの変更がプッシュ前に CI を通過することを確認できるように、リポジトリを設定します。
設定する内容
ローカル CI 検証を可能にする 2 つのスクリプトと、agents.md のセクションを用意します。
- install-act.sh —
actが見つからない場合にインストールします(プラットフォームを判別し、sudo にフォールバックします) - run-act.sh — エージェントのタイムアウトを避けるため、ログをポーリングしながらバックグラウンドで
actを実行します - AGENTS.md のセクション — Jules がこれらのスクリプトの使い方を把握するための手順です
設定手順
ステップ 1:スクリプトをリポジトリにコピーする
このスキルの scripts/ ディレクトリを、対象リポジトリの scripts/act/ にコピーします。
Target structure:
scripts/act/
├── install-act.sh
└── run-act.sh
スクリプトに実行権限があることを確認します。
chmod +x scripts/act/install-act.sh scripts/act/run-act.sh
ステップ 2:AGENTS.md に手順を追加する
次のセクションをリポジトリの AGENTS.md ファイルに追記します(ファイルが存在しない場合は作成してください)。これにより、Jules はローカル検証機能を把握できます。
## Local CI Verification
Before pushing code or opening a PR, verify changes pass CI locally using `act`.
### Prerequisites
- Docker must be running
- If `act` is not installed, run: `bash scripts/act/install-act.sh`
### How to Verify
1. Read `.github/workflows/` to find the CI workflow and identify the job ID
2. Run the verification script:
```bash
bash scripts/act/run-act.sh "push -j <JOB_ID>"
With matrix: bash scripts/act/run-act.sh "push -j <JOB_ID> --matrix <KEY>:<VALUE>"
3. 実行に失敗した場合は、ログ出力を読み、コードを修正して再実行します
4. 検証後、後片付けを行います。
rm -f act_output.log
git checkout <any unintended file changes>
設定
- タイムアウト:
ACT_TIMEOUT=900 bash scripts/act/run-act.sh "..."(デフォルト:600s) - ポーリング間隔:
ACT_POLL=15 bash scripts/act/run-act.sh "..."(デフォルト:10s) - カスタムイメージ:引数に
-P ubuntu-latest=node:20-bookwormを渡すと、イメージをより速く取得できます
### Step 3: Update .gitignore
Append these entries to `.gitignore` if they don't already exist:
act artifacts
act_output.log .secrets
### Step 4: Print next steps for the user
Tell the user:
1. Docker must be installed and running on any machine (or Jules VM) where verification runs
2. `act` will be auto-installed on first use via `scripts/act/install-act.sh`
3. If workflows require secrets, create a `.secrets` file (KEY=VALUE format) — never commit it
4. Commit all generated files
## Troubleshooting
- **Docker not running**: `act` requires Docker. Ensure the Docker daemon is started.
- **Image pull slow**: First run downloads ~2GB+. Use `-P ubuntu-latest=node:20-bookworm` for faster pulls.
- **ARM64 issues**: On Apple Silicon, add `--container-architecture linux/amd64` to act arguments.
- **Secrets required**: Create a `.secrets` file and pass `--secret-file .secrets` in the act arguments.
- **Timeout**: Increase with `ACT_TIMEOUT=1200 bash scripts/act/run-act.sh "..."`.
## Resource References
- [Troubleshooting Guide](resources/troubleshooting.md) — Detailed solutions for common issues
コメント
Markdown 対応