forked from hiero-ledger/hiero-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot-coderabbit-plan-trigger.yml
More file actions
52 lines (47 loc) · 1.83 KB
/
bot-coderabbit-plan-trigger.yml
File metadata and controls
52 lines (47 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# This workflow automatically triggers CodeRabbit's plan feature for intermediate and advanced issues.
# Fix for #1427: Only triggers when a beginner/intermediate/advanced label is specifically added,
# preventing duplicate runs when other labels are added to the same issue.
name: CodeRabbit Plan Trigger
on:
issues:
types: [labeled]
workflow_dispatch:
inputs:
dry_run:
description: "Run without posting comments"
required: false
default: "true"
type: choice
options:
- "true"
- "false"
permissions:
issues: write
contents: read
jobs:
coderabbit_plan_trigger:
runs-on: ubuntu-latest
concurrency:
group: coderabbit-plan-${{ github.event.issue.number }}
cancel-in-progress: false
# Only run when the newly added label is beginner, intermediate, or advanced (case-insensitive)
if: >
github.event_name == 'workflow_dispatch' ||
(github.event.action == 'labeled' &&
contains(fromJson('["beginner","intermediate","advanced","Beginner","Intermediate","Advanced"]'), github.event.label.name))
steps:
- name: Harden the runner
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
- name: Trigger CodeRabbit Plan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || 'false' }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd #v8.0.0
with:
script: |
const script = require('./.github/scripts/coderabbit_plan_trigger.js');
await script({ github, context});