-
-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (57 loc) · 1.78 KB
/
analyzePrompt.yml
File metadata and controls
64 lines (57 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Similar to the Copilot Triage Agent
name: Copilot Issue Helper
on:
issues:
types: [opened, edited, reopened]
permissions:
issues: write
contents: read
jobs:
process_issue:
runs-on: ubuntu-latest
steps:
- name: Summarize issue with Copilot
id: summary
uses: github/copilot-actions/summarize@v1
with:
text: |
Title: ${{ github.event.issue.title }}
Body: ${{ github.event.issue.body }}
- name: Suggest labels with Copilot
id: labels
uses: github/copilot-actions/label@v1
with:
text: |
Title: ${{ github.event.issue.title }}
Body: ${{ github.event.issue.body }}
- name: Apply labels
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = ${{ steps.labels.outputs.labels }};
if (labels && labels.length > 0) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels
});
}
- name: Comment summary
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: [
"### 🤖 Copilot Summary",
"",
`${{ steps.summary.outputs.summary }}`,
"",
"_Generated automatically by Copilot Actions._"
].join("\n")
})