Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d3554feff | |||
| 69c42bfb92 | |||
| cdb3bd2209 | |||
| 6f5ed7c70e |
@@ -0,0 +1,44 @@
|
|||||||
|
name: Claude Code Review
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, ready_for_review, reopened]
|
||||||
|
# Optional: Only run on specific file changes
|
||||||
|
# paths:
|
||||||
|
# - "src/**/*.ts"
|
||||||
|
# - "src/**/*.tsx"
|
||||||
|
# - "src/**/*.js"
|
||||||
|
# - "src/**/*.jsx"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
claude-review:
|
||||||
|
# Optional: Filter by PR author
|
||||||
|
# if: |
|
||||||
|
# github.event.pull_request.user.login == 'external-contributor' ||
|
||||||
|
# github.event.pull_request.user.login == 'new-developer' ||
|
||||||
|
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: read
|
||||||
|
issues: read
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Run Claude Code Review
|
||||||
|
id: claude-review
|
||||||
|
uses: anthropics/claude-code-action@v1
|
||||||
|
with:
|
||||||
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
|
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
|
||||||
|
plugins: 'code-review@claude-code-plugins'
|
||||||
|
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
|
||||||
|
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
||||||
|
# or https://code.claude.com/docs/en/cli-reference for available options
|
||||||
|
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
name: Claude Code
|
||||||
|
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
pull_request_review_comment:
|
||||||
|
types: [created]
|
||||||
|
issues:
|
||||||
|
types: [opened, assigned]
|
||||||
|
pull_request_review:
|
||||||
|
types: [submitted]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
claude:
|
||||||
|
if: |
|
||||||
|
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
||||||
|
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
||||||
|
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
||||||
|
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: read
|
||||||
|
issues: read
|
||||||
|
id-token: write
|
||||||
|
actions: read # Required for Claude to read CI results on PRs
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Run Claude Code
|
||||||
|
id: claude
|
||||||
|
uses: anthropics/claude-code-action@v1
|
||||||
|
with:
|
||||||
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
|
|
||||||
|
# This is an optional setting that allows Claude to read CI results on PRs
|
||||||
|
additional_permissions: |
|
||||||
|
actions: read
|
||||||
|
|
||||||
|
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
|
||||||
|
# prompt: 'Update the pull request description to include a summary of changes.'
|
||||||
|
|
||||||
|
# Optional: Add claude_args to customize behavior and configuration
|
||||||
|
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
||||||
|
# or https://code.claude.com/docs/en/cli-reference for available options
|
||||||
|
# claude_args: '--allowed-tools Bash(gh pr:*)'
|
||||||
|
|
||||||
@@ -34,6 +34,8 @@ The official Obsidian CLI (released in v1.12, February 2026) lets you control ev
|
|||||||
|
|
||||||
- **macOS / Linux**: The `obsidian` binary is registered in PATH automatically when you enable CLI in settings.
|
- **macOS / Linux**: The `obsidian` binary is registered in PATH automatically when you enable CLI in settings.
|
||||||
- **Windows**: Requires an `Obsidian.com` redirector file placed alongside `Obsidian.exe`. **Must run with normal user privileges** — admin terminals produce silent failures.
|
- **Windows**: Requires an `Obsidian.com` redirector file placed alongside `Obsidian.exe`. **Must run with normal user privileges** — admin terminals produce silent failures.
|
||||||
|
- If colon subcommands (`property:set`, `daily:append`, etc.) with parameters return exit 127, verify that `Obsidian.com` exists alongside `Obsidian.exe`. Users who installed before v1.12 and updated in-app may be missing this file — download the latest installer from [obsidian.md/download](https://obsidian.md/download) to fix.
|
||||||
|
- **Git Bash / MSYS2 users**: Bash does not follow Windows' `.com`-before-`.exe` priority, so `obsidian` resolves to `Obsidian.exe` (GUI mode) instead of `Obsidian.com` (CLI). Create a wrapper script — see Troubleshooting.
|
||||||
- **Headless Linux**: Use the `.deb` package (not snap). Run under `xvfb`. Prefix commands with `DISPLAY=:5` (or your xvfb display number). Ensure `PrivateTmp=false` if running as a service.
|
- **Headless Linux**: Use the `.deb` package (not snap). Run under `xvfb`. Prefix commands with `DISPLAY=:5` (or your xvfb display number). Ensure `PrivateTmp=false` if running as a service.
|
||||||
|
|
||||||
## Syntax
|
## Syntax
|
||||||
@@ -241,6 +243,7 @@ obsidian command id="dataview:dataview-force-refresh-views"
|
|||||||
obsidian eval code="$(cat /tmp/obs.js)"
|
obsidian eval code="$(cat /tmp/obs.js)"
|
||||||
```
|
```
|
||||||
12. **Multi-vault targeting may not work in all environments** — `obsidian "My Vault" command` can return `Error: Command "My Vault" not found` on some setups. If this happens, omit the vault name (CLI targets the most recently active vault) and switch vaults manually in the Obsidian UI.
|
12. **Multi-vault targeting may not work in all environments** — `obsidian "My Vault" command` can return `Error: Command "My Vault" not found` on some setups. If this happens, omit the vault name (CLI targets the most recently active vault) and switch vaults manually in the Obsidian UI.
|
||||||
|
13. **When colon subcommands are unavailable** (e.g., missing `Obsidian.com` on Windows), prefer non-colon alternatives: use `properties` instead of `property:read`, or `obsidian daily:path` + `obsidian append path="..."` instead of `daily:append`. Most read-only and file operations work without colon subcommands.
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
@@ -254,3 +257,5 @@ obsidian command id="dataview:dataview-force-refresh-views"
|
|||||||
| Snap confinement issues | Snap restricts IPC | Use `.deb` package instead |
|
| Snap confinement issues | Snap restricts IPC | Use `.deb` package instead |
|
||||||
| Multi-vault `"Name" command` fails | Vault name matching issue | Omit vault name; target most recent vault |
|
| Multi-vault `"Name" command` fails | Vault name matching issue | Omit vault name; target most recent vault |
|
||||||
| `property:set` list value is a string | CLI stores value as-is | Edit frontmatter directly or use `eval` |
|
| `property:set` list value is a string | CLI stores value as-is | Edit frontmatter directly or use `eval` |
|
||||||
|
| Colon+params exit 127 (Windows, `Obsidian.com` missing) | Outdated installer — in-app update skips `.com` file | Reinstall from [obsidian.md/download](https://obsidian.md/download) |
|
||||||
|
| Colon+params exit 127 (Git Bash / MSYS2) | Bash resolves `obsidian` to `.exe` (GUI), not `.com` (CLI) | Create `~/bin/obsidian` wrapper: `#!/bin/bash`<br>`/c/Users/<you>/AppData/Local/Obsidian/Obsidian.com "$@"` and add `export PATH="$HOME/bin:$PATH"` to `~/.bashrc` |
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ The official Obsidian CLI (released in v1.12, February 2026) lets you control ev
|
|||||||
|
|
||||||
- **macOS / Linux**: The `obsidian` binary is registered in PATH automatically when you enable CLI in settings.
|
- **macOS / Linux**: The `obsidian` binary is registered in PATH automatically when you enable CLI in settings.
|
||||||
- **Windows**: Requires an `Obsidian.com` redirector file placed alongside `Obsidian.exe`. **Must run with normal user privileges** — admin terminals produce silent failures.
|
- **Windows**: Requires an `Obsidian.com` redirector file placed alongside `Obsidian.exe`. **Must run with normal user privileges** — admin terminals produce silent failures.
|
||||||
|
- If colon subcommands (`property:set`, `daily:append`, etc.) with parameters return exit 127, verify that `Obsidian.com` exists alongside `Obsidian.exe`. Users who installed before v1.12 and updated in-app may be missing this file — download the latest installer from [obsidian.md/download](https://obsidian.md/download) to fix.
|
||||||
|
- **Git Bash / MSYS2 users**: Bash does not follow Windows' `.com`-before-`.exe` priority, so `obsidian` resolves to `Obsidian.exe` (GUI mode) instead of `Obsidian.com` (CLI). Create a wrapper script — see Troubleshooting.
|
||||||
- **Headless Linux**: Use the `.deb` package (not snap). Run under `xvfb`. Prefix commands with `DISPLAY=:5` (or your xvfb display number). Ensure `PrivateTmp=false` if running as a service.
|
- **Headless Linux**: Use the `.deb` package (not snap). Run under `xvfb`. Prefix commands with `DISPLAY=:5` (or your xvfb display number). Ensure `PrivateTmp=false` if running as a service.
|
||||||
|
|
||||||
## Syntax
|
## Syntax
|
||||||
@@ -241,6 +243,7 @@ obsidian command id="dataview:dataview-force-refresh-views"
|
|||||||
obsidian eval code="$(cat /tmp/obs.js)"
|
obsidian eval code="$(cat /tmp/obs.js)"
|
||||||
```
|
```
|
||||||
12. **Multi-vault targeting may not work in all environments** — `obsidian "My Vault" command` can return `Error: Command "My Vault" not found` on some setups. If this happens, omit the vault name (CLI targets the most recently active vault) and switch vaults manually in the Obsidian UI.
|
12. **Multi-vault targeting may not work in all environments** — `obsidian "My Vault" command` can return `Error: Command "My Vault" not found` on some setups. If this happens, omit the vault name (CLI targets the most recently active vault) and switch vaults manually in the Obsidian UI.
|
||||||
|
13. **When colon subcommands are unavailable** (e.g., missing `Obsidian.com` on Windows), prefer non-colon alternatives: use `properties` instead of `property:read`, or `obsidian daily:path` + `obsidian append path="..."` instead of `daily:append`. Most read-only and file operations work without colon subcommands.
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
@@ -254,3 +257,5 @@ obsidian command id="dataview:dataview-force-refresh-views"
|
|||||||
| Snap confinement issues | Snap restricts IPC | Use `.deb` package instead |
|
| Snap confinement issues | Snap restricts IPC | Use `.deb` package instead |
|
||||||
| Multi-vault `"Name" command` fails | Vault name matching issue | Omit vault name; target most recent vault |
|
| Multi-vault `"Name" command` fails | Vault name matching issue | Omit vault name; target most recent vault |
|
||||||
| `property:set` list value is a string | CLI stores value as-is | Edit frontmatter directly or use `eval` |
|
| `property:set` list value is a string | CLI stores value as-is | Edit frontmatter directly or use `eval` |
|
||||||
|
| Colon+params exit 127 (Windows, `Obsidian.com` missing) | Outdated installer — in-app update skips `.com` file | Reinstall from [obsidian.md/download](https://obsidian.md/download) |
|
||||||
|
| Colon+params exit 127 (Git Bash / MSYS2) | Bash resolves `obsidian` to `.exe` (GUI), not `.com` (CLI) | Create `~/bin/obsidian` wrapper: `#!/bin/bash`<br>`/c/Users/<you>/AppData/Local/Obsidian/Obsidian.com "$@"` and add `export PATH="$HOME/bin:$PATH"` to `~/.bashrc` |
|
||||||
|
|||||||
Reference in New Issue
Block a user