Skip to content

Commit ae6e47b

Browse files
authored
tweak: make gh action ignore url mentions of opencode (#1531)
1 parent 42a5fce commit ae6e47b

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎.github/workflows/opencode.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ on:
77
jobs:
88
opencode:
99
if: |
10-
contains(github.event.comment.body, '/oc') ||
11-
contains(github.event.comment.body, '/opencode')
10+
contains(github.event.comment.body, ' /oc') ||
11+
startsWith(github.event.comment.body, '/oc') ||
12+
contains(github.event.comment.body, ' /opencode') ||
13+
startsWith(github.event.comment.body, '/opencode')
1214
runs-on: ubuntu-latest
1315
permissions:
1416
contents: read
@@ -24,4 +26,4 @@ jobs:
2426
env:
2527
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
2628
with:
27-
model: anthropic/claude-sonnet-4-20250514
29+
model: anthropic/claude-sonnet-4-20250514

‎packages/opencode/src/cli/cmd/github.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,10 @@ on:
318318
jobs:
319319
opencode:
320320
if: |
321-
contains(github.event.comment.body, '/oc') ||
322-
contains(github.event.comment.body, '/opencode')
321+
contains(github.event.comment.body, ' /oc') ||
322+
startsWith(github.event.comment.body, '/oc') ||
323+
contains(github.event.comment.body, ' /opencode') ||
324+
startsWith(github.event.comment.body, '/opencode')
323325
runs-on: ubuntu-latest
324326
permissions:
325327
contents: read
@@ -784,7 +786,7 @@ export const GithubRunCommand = cmd({
784786
console.log("Pushing to new branch...")
785787
await $`git add .`
786788
await $`git commit -m "${summary}
787-
789+
788790
Co-authored-by: ${actor} <${actor}@users.noreply.github.com>"`
789791
await $`git push -u origin ${branch}`
790792
}
@@ -793,7 +795,7 @@ Co-authored-by: ${actor} <${actor}@users.noreply.github.com>"`
793795
console.log("Pushing to local branch...")
794796
await $`git add .`
795797
await $`git commit -m "${summary}
796-
798+
797799
Co-authored-by: ${actor} <${actor}@users.noreply.github.com>"`
798800
await $`git push`
799801
}
@@ -805,7 +807,7 @@ Co-authored-by: ${actor} <${actor}@users.noreply.github.com>"`
805807

806808
await $`git add .`
807809
await $`git commit -m "${summary}
808-
810+
809811
Co-authored-by: ${actor} <${actor}@users.noreply.github.com>"`
810812
await $`git push fork HEAD:${remoteBranch}`
811813
}

0 commit comments

Comments
 (0)