Skip to content

What should we add? #14

What should we add?

What should we add? #14

name: Summarize new issues slash command
on:
issue_comment:
types: [created]
jobs:
summary:
runs-on: ubuntu-latest
permissions:
issues: write
models: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run AI inference
id: inference
if: github.event.issue.issue && contains(github.event.comment.body, 'ChatGPT /summarize-op')
uses: actions/ai-inference@v1
with:
prompt: |
Summarize the following GitHub issue in one paragraph:
Title: ${{ github.event.issue.title }}
Body: ${{ github.event.issue.body }}
- name: Comment with AI summary
if: github.event.issue.issue && contains(github.event.comment.body, 'ChatGPT /summarize-op')
run: |
gh issue comment $ISSUE_NUMBER --body 'Here is an AI Summary of what the OP wrote: ${{ steps.inference.outputs.response }}'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
RESPONSE: ${{ steps.inference.outputs.response }}