Template
mirror of
https://github.com/MorpheApp/morphe-patches-template.git
synced 2026-11-30 23:09:34 +00:00
chore: Add AI issue triage using OpenRouter
This commit is contained in:
1 parent
dc5b4cf4b4
commit
b222d12a46
3 files changed
+554
No files matched your search
@@ -0,0 +1,57 @@
|
||||
name: Issue triage
|
||||
|
||||
# AI issue triage using OpenRouter. See the "AI issue triage" section of the README.
|
||||
# To turn it off: Actions tab > Issue triage > "..." menu > Disable workflow.
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, edited]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
issue_number:
|
||||
description: Issue number to triage
|
||||
required: true
|
||||
type: number
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
name: Triage issue
|
||||
# Besides new issues, only changes by the author to an issue closed as not planned are of interest.
|
||||
if: >-
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
(github.event_name == 'issues' && github.event.action == 'opened') ||
|
||||
(!github.event.issue.pull_request &&
|
||||
github.event.issue.state == 'closed' &&
|
||||
github.event.issue.state_reason == 'not_planned' &&
|
||||
github.event.sender.login == github.event.issue.user.login)
|
||||
# One run at a time for each issue, so an issue cannot be re-checked twice.
|
||||
concurrency:
|
||||
group: issue-triage-${{ github.event.issue.number || inputs.issue_number }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
sparse-checkout: .github/scripts/issue-triage
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Triage issue
|
||||
uses: actions/github-script@v9
|
||||
env:
|
||||
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
|
||||
# Optional repository variables.
|
||||
OPENROUTER_MODEL: ${{ vars.OPENROUTER_MODEL }}
|
||||
TRIAGE_MODE: ${{ vars.ISSUE_TRIAGE_MODE }}
|
||||
INCLUDE_MAINTAINERS: ${{ vars.ISSUE_TRIAGE_INCLUDE_MAINTAINERS }}
|
||||
with:
|
||||
script: |
|
||||
const run = require('./.github/scripts/issue-triage/triage.js');
|
||||
await run({ github, context, core });
|
||||
Reference in new issue
Block a user