Skip to content

Commit b08f82c

Browse files
committed
fun!
1 parent 55193e4 commit b08f82c

File tree

4 files changed

+56
-16
lines changed

4 files changed

+56
-16
lines changed

.github/actions/triage-apply/action.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,21 @@ runs:
4040
"merged-file=$out" >> $env:GITHUB_OUTPUT
4141
echo "::endgroup::"
4242
43-
- name: Summarize labels
44-
id: summarize
45-
shell: pwsh
46-
run: |
47-
cat "${{ steps.merge.outputs.merged-file }}"
43+
- name: Create User prompt file
44+
id: create-user-prompt
45+
uses: ./.github/actions/triage-gen-prompt
46+
with:
47+
token: ${{ inputs.token }}
48+
template: ${{ github.action_path }}/user-prompt.md
49+
output: ${{ steps.setup.outputs.work-dir }}/user-prompt.md
50+
51+
- name: Run Triage AI Action
52+
id: triage-ai
53+
uses: ./.github/actions/triage-ai
54+
with:
55+
prompt-file: "${{ steps.create-system-prompt.outputs.prompt }}"
56+
token: ${{ inputs.token }}
57+
response-file: "${{ steps.setup.outputs.work-dir }}/ai-response.json"
4858

4959

5060
# - name: Comment on the issue with summary
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
You are an assistant helping to triage GitHub issues. Your
2+
focus is to summarize some actions and then prove the user
3+
with an easy to understand message while also being detailed.
4+
5+
**Information To Summarize**
6+
7+
The following labels will be applied for the specified reasons:
8+
9+
EXEC: jq -r '"| Label | Reason |", "|:-|:-|", (.labels[] | "| \(.label) | \(.reason) |")' merged.json
10+
11+
12+
**Summarization Process**
13+
14+
* Summarize all the labels that are being applied in a
15+
single, short sentence.
16+
* Provide a sentence or two summarizing in more detail about
17+
the labels to be applied.
18+
* Create a table for all the actions that will be performed.
19+
20+
21+
**Response**
22+
23+
* Respond in valid and properly formatted JSON with the
24+
following structure and only in this structure.
25+
* Do not wrap the JSON in any other text or formatting,
26+
including code blocks or markdown.
27+
28+
{
29+
"summary": "SHORT_SUMMARY",
30+
"details": "DETAILED_SUMMARY",
31+
"actions": "COMPLETE_ACTION_TABLE"
32+
}

.github/actions/triage-gen-prompt/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ outputs:
2828
runs:
2929
using: 'composite'
3030
steps:
31+
3132
- name: Create prompt file
3233
id: create-prompt
3334
shell: pwsh
@@ -43,3 +44,11 @@ runs:
4344
-Output "${{ inputs.output }}"
4445
"prompt=${{ inputs.output }}" >> $env:GITHUB_OUTPUT
4546
echo "::endgroup::"
47+
48+
- name: Print prompt file
49+
shell: pwsh
50+
run: |
51+
"Print prompt file"
52+
echo "::group::Print prompt file"
53+
cat "${{ steps.create-prompt.outputs.prompt }}"
54+
echo "::endgroup::"

.github/actions/triage-labels/action.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,6 @@ runs:
9494
template: ${{ github.action_path }}/user-prompt.md
9595
output: ${{ steps.setup.outputs.work-dir }}/user-prompt.md
9696

97-
- name: Print prompt files
98-
shell: pwsh
99-
run: |
100-
"Print prompt files"
101-
echo "::group::System Prompt"
102-
cat "${{ steps.create-system-prompt.outputs.prompt }}"
103-
echo "::endgroup::"
104-
echo "::group::User Prompt"
105-
cat "${{ steps.create-user-prompt.outputs.prompt }}"
106-
echo "::endgroup::"
107-
10897
- name: Run Triage AI Action
10998
id: triage-ai
11099
uses: ./.github/actions/triage-ai

0 commit comments

Comments
 (0)