From a041377b16caa5c111c5d0f367e294a1335509d0 Mon Sep 17 00:00:00 2001 From: Sean Goedecke Date: Tue, 22 Apr 2025 06:16:47 +0000 Subject: [PATCH 1/4] Add summary preview workflow --- automation/properties/summary.properties.json | 7 ++++ automation/summary.yml | 33 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 automation/properties/summary.properties.json create mode 100644 automation/summary.yml diff --git a/automation/properties/summary.properties.json b/automation/properties/summary.properties.json new file mode 100644 index 0000000..71b47c9 --- /dev/null +++ b/automation/properties/summary.properties.json @@ -0,0 +1,7 @@ +{ + "name": "AI issue summary", + "description": "Summarizes new issues", + "iconName": "octicon ai-model", + "categories": ["Automation", "SDLC"], + "labels": ["preview"] +} diff --git a/automation/summary.yml b/automation/summary.yml new file mode 100644 index 0000000..63e54ad --- /dev/null +++ b/automation/summary.yml @@ -0,0 +1,33 @@ +name: Summarize new issues + +on: + issues: + types: [opened] + +jobs: + summary: + runs-on: ubuntu-latest + permissions: + issues: write + models: read + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Run AI Inference + id: inference + 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 + run: | + gh issue comment $ISSUE_NUMBER --body '${{ steps.inference.outputs.response }}' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE_NUMBER: ${{ github.event.issue.number }} \ No newline at end of file From f0c24a69515f14f466fad42696124641c5f140ff Mon Sep 17 00:00:00 2001 From: Sean Goedecke Date: Tue, 22 Apr 2025 06:21:00 +0000 Subject: [PATCH 2/4] Sentence case step names --- automation/summary.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/automation/summary.yml b/automation/summary.yml index 63e54ad..0494ce0 100644 --- a/automation/summary.yml +++ b/automation/summary.yml @@ -14,8 +14,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - - - name: Run AI Inference + + - name: Run AI inference id: inference uses: actions/ai-inference@v1 with: @@ -25,7 +25,7 @@ jobs: Title: ${{ github.event.issue.title }} Body: ${{ github.event.issue.body }} - - name: Comment with AI Summary + - name: Comment with AI summary run: | gh issue comment $ISSUE_NUMBER --body '${{ steps.inference.outputs.response }}' env: From f1f24bdbc64df1e0c98745cbbd39784f5878228d Mon Sep 17 00:00:00 2001 From: Sean Goedecke Date: Tue, 22 Apr 2025 06:22:40 +0000 Subject: [PATCH 3/4] Remove newline --- automation/summary.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/automation/summary.yml b/automation/summary.yml index 0494ce0..321dcb5 100644 --- a/automation/summary.yml +++ b/automation/summary.yml @@ -21,7 +21,6 @@ jobs: with: prompt: | Summarize the following GitHub issue in one paragraph: - Title: ${{ github.event.issue.title }} Body: ${{ github.event.issue.body }} From 17b8575ef8c32ef1126349d3f3500188b7818d46 Mon Sep 17 00:00:00 2001 From: Sean Goedecke Date: Tue, 22 Apr 2025 21:41:43 +0000 Subject: [PATCH 4/4] Use latest version of checkout, add permission for checkout, and use RESPONSE variable --- automation/summary.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/automation/summary.yml b/automation/summary.yml index 321dcb5..4a8e31f 100644 --- a/automation/summary.yml +++ b/automation/summary.yml @@ -10,10 +10,11 @@ jobs: permissions: issues: write models: read + contents: read steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run AI inference id: inference @@ -29,4 +30,5 @@ jobs: gh issue comment $ISSUE_NUMBER --body '${{ steps.inference.outputs.response }}' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ISSUE_NUMBER: ${{ github.event.issue.number }} \ No newline at end of file + ISSUE_NUMBER: ${{ github.event.issue.number }} + RESPONSE: ${{ steps.inference.outputs.response }} \ No newline at end of file