Skip to content

Commit 9188b78

Browse files
committed
simplify CodeRabbit workflow
1 parent dd5202c commit 9188b78

2 files changed

Lines changed: 3 additions & 23 deletions

File tree

.github/scripts/coderabbit_plan_trigger.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@
22

33
const CODERABBIT_MARKER = '<!-- CodeRabbit Plan Trigger -->';
44

5-
async function triggerCodeRabbitPlan(github, owner, repo, issue, marker = CODERABBIT_MARKER, isDryRun = false) {
5+
async function triggerCodeRabbitPlan(github, owner, repo, issue, marker = CODERABBIT_MARKER) {
66
const comment = `${marker} @coderabbitai plan`;
77

8-
if (isDryRun) {
9-
console.log(`[DRY RUN] Would trigger CodeRabbit plan for issue #${issue.number}`);
10-
return true;
11-
}
12-
138
try {
149
await github.rest.issues.createComment({
1510
owner,
@@ -105,11 +100,8 @@ async function main({ github, context }) {
105100
return console.log(`CodeRabbit plan already triggered for #${issue.number}`);
106101
}
107102

108-
// Check for dry run (default to true if not specified, for safety)
109-
const isDryRun = (process.env.DRY_RUN || 'true').toLowerCase() === 'true';
110-
111103
// Post CodeRabbit plan trigger
112-
await triggerCodeRabbitPlan(github, owner, repo, issue, CODERABBIT_MARKER, isDryRun);
104+
await triggerCodeRabbitPlan(github, owner, repo, issue, CODERABBIT_MARKER);
113105

114106
logSummary(owner, repo, issue);
115107
} catch (err) {

.github/workflows/bot-coderabbit-plan-trigger.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ name: CodeRabbit Plan Trigger
55
on:
66
issues:
77
types: [labeled]
8-
workflow_dispatch:
9-
inputs:
10-
dry_run:
11-
description: "Run without posting comments"
12-
required: false
13-
default: "true"
14-
type: choice
15-
options:
16-
- "true"
17-
- "false"
188

199
permissions:
2010
issues: write
@@ -28,8 +18,7 @@ jobs:
2818
cancel-in-progress: false
2919
# Only run when the newly added label is beginner, intermediate, or advanced (case-insensitive)
3020
if: >
31-
github.event_name == 'workflow_dispatch' ||
32-
(github.event.action == 'labeled' &&
21+
github.event.action == 'labeled' &&
3322
github.event.issue.state == 'open' &&
3423
contains(fromJson('["beginner","intermediate","advanced","Beginner","Intermediate","Advanced"]'), github.event.label.name))
3524
@@ -45,7 +34,6 @@ jobs:
4534
- name: Trigger CodeRabbit Plan
4635
env:
4736
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48-
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || 'false' }}
4937
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 #v9.0.0
5038
with:
5139
script: |

0 commit comments

Comments
 (0)