Skip to content

test: coderabbit lock unlock e2e #21

test: coderabbit lock unlock e2e

test: coderabbit lock unlock e2e #21

# Triggers CodeRabbit's plan feature when a skill label is added to an already-approved (unlocked) issue.
# Primary trigger path: approved-issues.yml fires CodeRabbit immediately after unlocking the issue.
# This workflow is the fallback: fires when a skill label arrives after the issue was already approved and unlocked.
name: CodeRabbit Plan Trigger
on:
issues:
types: [labeled]
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 a skill label is added to an open, unlocked, approved issue.
# This guards against triggering while the issue is still locked (newly created issues).
if: >
github.event.issue.state == 'open' &&
github.event.issue.locked == false &&
contains(github.event.issue.labels.*.name, 'approved') &&
contains(fromJson('["skill: beginner","skill: intermediate","skill: advanced"]'), github.event.label.name)
steps:
- name: Harden the runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 #v6.0.3
with:
persist-credentials: false
- name: Trigger CodeRabbit Plan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 #v9.0.0
with:
script: |
const script = require('./.github/scripts/coderabbit_plan_trigger.js');
await script({ github, context});