メインコンテンツまでスキップ

ガイド:自動更新

概要

oh-my-agent GitHub Action(first-fluke/oma-update-action@v1)は、CIでoma updateを実行してプロジェクトのエージェントスキルを自動更新します。PRを作成してレビューするモードと、ブランチに直接コミットするモードをサポート。


クイックセットアップ

.github/workflows/update-oh-my-agent.ymlとして追加:

name: Update oh-my-agent

on:
schedule:
- cron: '0 9 * * 1' # 毎週月曜9時UTC
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: first-fluke/oma-update-action@v1

全Action入力

入力デフォルト説明
modestring"pr""pr"でPR作成、"commit"で直接コミット
base-branchstring"main"PRのベースブランチまたはコミット先
forcestring"false""true"でカスタム設定を上書き
pr-titlestring"chore(deps): update oh-my-agent skills"PRタイトル
pr-labelsstring"dependencies,automated"カンマ区切りラベル
commit-messagestring"chore(deps): update oh-my-agent skills"コミットメッセージ
tokenstring${{ github.token }}GitHubトークン

全Action出力

出力説明
updated変更検出時"true"
version更新後のバージョン
pr-numberPR番号(prモード)
pr-urlPR URL(prモード)

詳細例

例1:デフォルトPRモード

- uses: first-fluke/oma-update-action@v1
id: update
- name: Summary
if: steps.update.outputs.updated == 'true'
run: echo "Updated to v${{ steps.update.outputs.version }}"

例2:直接コミット + PAT

- uses: actions/checkout@v4
with:
token: ${{ secrets.OH_MY_AGENT_PAT }}
- uses: first-fluke/oma-update-action@v1
with:
mode: commit
token: ${{ secrets.OH_MY_AGENT_PAT }}
base-branch: develop

例3:Slack通知付き

- uses: first-fluke/oma-update-action@v1
id: update
- name: Notify Slack
if: steps.update.outputs.updated == 'true'
uses: slackapi/slack-github-action@v2
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
webhook-type: incoming-webhook
payload: |
{"text": "oh-my-agent updated to v${{ steps.update.outputs.version }}"}

例4:強制更新

- uses: first-fluke/oma-update-action@v1
with:
force: 'true'
pr-title: "chore(deps): force-update oh-my-agent skills (reset configs)"

注意: forceモードはoma-config.yamlmcp.jsonstack/を上書きします。


内部動作

  1. Bunセットアップoven-sh/setup-bun@v2
  2. oh-my-agentインストールbun install -g oh-my-agent
  3. oma update実行--ciフラグ(非インタラクティブ)、オプションで--force
  4. 変更チェック.agents/.claude/のgit status確認
  5. モードに応じて処理 — PRモード:peter-evans/create-pull-request@v8使用。コミットモード:直接コミット・プッシュ。

oma update --ciの内部処理:

  1. レジストリからprompt-manifest.json取得
  2. ローカルバージョンと比較
  3. 最新tarballダウンロード・展開
  4. ユーザーカスタム設定を保持(--force除く)
  5. ベンダー適応とシンボリックリンクを更新