Add logic to process new logs when an issue is edited (#11544)
* Add logic to review edited issues if log files were added * Add workflow * yaml * yaml * yaml * yaml * yaml
Blue committed
May 3, 2024 at 20:30 UTC
676a8c9f2beea45528760616fef75bfaacccb12e
2 files changed
+54
-2
.github/actions/triage/action.yml
+14
-2
@@ -14,6 +14,9 @@ inputs:
14
token:
15
required: false
16
type: string
17
+ previous_body:
18
+ required: false
19
+ type: string
20
21
runs:
22
using: "composite"
@@ -21,6 +24,8 @@ runs:
24
- name: 'Run WTI'
25
if: ${{ !contains(inputs.similar_issues_text, '''@') }} # Skip this step if the description contains a string that will break the here document
26
shell: pwsh
27
+ env:
28
+ previous_body: "${{ inputs.previous_body }}"
29
run: |
30
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
31
$message = @'
@@ -39,6 +44,13 @@ runs:
44
$maybe_comment = @("--comment", "${{ inputs.comment }}")
45
}
46
42
- curl.exe -L https://github.com/OneBlue/wti/releases/download/v0.1.7/wti.exe -o triage/wti.exe
47
+ $maybe_previous_body = @()
48
+ if (![string]::IsNullOrEmpty("$env:previous_body"))
49
+ {
50
+ $env:previous_body | Out-File -Encoding utf8 "triage\previous_body.txt"
51
+ $maybe_previous_body = @("--previous-issue-body", "previous_body.txt")
52
+ }
53
+
54
+ curl.exe -L https://github.com/OneBlue/wti/releases/download/v0.1.8/wti.exe -o triage/wti.exe
55
44
- cd triage && echo -n $message | .\wti.exe --issue ${{ inputs.issue }} --config config.yml --github-token "${{ inputs.token }}" --ignore-tags @maybe_message @maybe_comment
\ No newline at end of file
56
+ cd triage && echo -n $message | .\wti.exe --issue ${{ inputs.issue }} --config config.yml --github-token "${{ inputs.token }}" --ignore-tags @maybe_message @maybe_comment @maybe_previous_body
\ No newline at end of file
.github/workflows/issue_edited.yml
new
+40
@@ -0,0 +1,40 @@
1
+name: Process edited issue
2
+
3
+on:
4
+ workflow_dispatch:
5
+ issues:
6
+ types: [edited]
7
+
8
+jobs:
9
+ getSimilarIssues:
10
+ runs-on: ubuntu-latest
11
+ outputs:
12
+ message: ${{ steps.getBody.outputs.message }}
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - id: getBody
16
+ uses: craigloewen-msft/GitGudSimilarIssues@main
17
+ with:
18
+ issueTitle: ${{ github.event.issue.title }}
19
+ issueBody: ${{ github.event.issue.body }}
20
+ repository: ${{ github.repository }}
21
+ similarityTolerance: "0.7"
22
+ commentBody: |
23
+ # View similar issues
24
+ Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!
25
+ wti:
26
+ name: Run wti
27
+ needs: getSimilarIssues
28
+ runs-on: windows-2022
29
+ permissions:
30
+ issues: write
31
+ steps:
32
+ - name: Checkout repo
33
+ uses: actions/checkout@v4
34
+
35
+ - uses: ./.github/actions/triage
36
+ with:
37
+ similar_issues_text: "${{ needs.getSimilarIssues.outputs.message }}"
38
+ issue: "${{ github.event.issue.number }}"
39
+ previous_body: "${{ github.event.changes.body.from }}"
40
+ token: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file