Loading...
Loading...
Issue/PR の状態とプロジェクト Status の自動同期を設定する。モード A は `Fandhe-AI/actions/project-sync` Composite Action を使う `.github/workflows/project-sync.yml` を生成 (PAT または GitHub App トークン)。モード B は既存の不整合を一括補正。「自動同期セットアップ」「PR レビュー時に In Review 化」「ボードと Issue の状態を同期」などで使用。
npx skill4agent add fandhe-ai/agent-cli-skills project-sync-issuesghproject# オーナーを取得
gh repo view --json owner -q '.owner.login'
# プロジェクト番号を確認
gh project list --owner <owner> --format jsonGITHUB_TOKENprojectissuespull_requestsPROJECT_TOKENProjects: Read and writeactions/create-github-app-tokenFandhe-AI/actions/project-sync.github/workflows/project-sync.ymlname: Project Sync
on:
issues:
types: [opened, closed, reopened]
pull_request:
types: [opened, closed, ready_for_review, review_requested]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Sync project status
uses: Fandhe-AI/actions/project-sync@main
with:
project-number: '<number>'
project-owner: '<owner>'
token: ${{ secrets.PROJECT_TOKEN }}name: Project Sync
on:
issues:
types: [opened, closed, reopened]
pull_request:
types: [opened, closed, ready_for_review, review_requested]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: '<owner>'
- name: Sync project status
uses: Fandhe-AI/actions/project-sync@main
with:
project-number: '<number>'
project-owner: '<owner>'
token: ${{ steps.token.outputs.token }} - name: Sync project status
uses: Fandhe-AI/actions/project-sync@main
with:
project-number: '<number>'
project-owner: '<owner>'
token: ${{ secrets.PROJECT_TOKEN }}
status-todo: 'バックログ'
status-in-progress: '作業中'
status-in-review: 'レビュー中'
status-done: '完了'| イベント | アクション | Status |
|---|---|---|
| Issue | opened | Todo |
| Issue | closed | Done |
| Issue | reopened | Todo |
| PR | opened | In Progress |
| PR | ready_for_review | In Review |
| PR | review_requested | In Review |
| PR | closed (merged) | Done |
| PR | closed (not merged) | Todo |
mkdir -p .github/workflows
# ワークフローファイルを .github/workflows/project-sync.yml に書き出すgh project item-list <number> \
--owner <owner> \
--format json \
--limit 999gh issue view <issue-url> --json state,labels,assignees
gh pr view <pr-url> --json state,isDraft,reviewRequests,mergedgh issue list --state open --json number,url,title --limit 999
gh pr list --state open --json number,url,title --limit 999## 同期内容
### ステータス更新(N 件)
- #42: ソーシャルログイン — Status: In Progress → Done(Issue closed)
- #45: バグ修正 — Status: Done → Todo(Issue reopened)
- #50: リファクタリング PR — Status: In Progress → In Review(レビュー依頼済み)
### 新規追加(M 件)
- #55: 新機能リクエスト (Issue)
- #56: ドキュメント更新 PR
実行しますか?# フィールドメタデータを取得
gh project field-list <number> --owner <owner> --format json
# ステータス更新
gh project item-edit \
--id <item-id> \
--field-id <status-field-id> \
--project-id <project-id> \
--single-select-option-id <option-id>
# 新規追加
gh project item-add <number> \
--owner <owner> \
--url <issue-or-pr-url> \
--format json| 操作 | 件数 |
|---|---|
| ステータス更新 | N 件 |
| 新規追加 | M 件 |
| 変更なし | K 件 |
GITHUB_TOKENproject-initGIT_SSL_NO_VERIFY=1GIT_SSL_NO_VERIFY=1git pushgh project item-editgh issue listdocs/sandbox-tls.md