Skip to content

testing labels (intermediate) #3

testing labels (intermediate)

testing labels (intermediate) #3

# 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: hl-sdk-py-lin-md
concurrency:
group: coderabbit-plan-${{ github.event.issue.number }}
cancel-in-progress: false
# Only run when the newly added label is a difficulty label (skill: beginner/intermediate/advanced)
if: >
github.event_name == 'workflow_dispatch' ||
(github.event.action == 'labeled' &&
github.event.issue.state == 'open' &&
contains(fromJson('["skill: beginner","skill: intermediate","skill: advanced"]'), github.event.label.name))
steps:
- name: Harden the runner
uses: step-security/harden-runner@6c3c2f2c1c457b00c10c4848d6f5491db3b629df # v2.18.0
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@3a2844b7e9c422d3c10d287c895573f7108da1b3 #v9.0.0
with:
script: |
const script = require('./.github/scripts/coderabbit_plan_trigger.js');
await script({ github, context});