-
Notifications
You must be signed in to change notification settings - Fork 3k
45 lines (42 loc) · 1.67 KB
/
addCommentToRemindUpdatingTemplateVersion.yml
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
name: run script on changing detections
on:
pull_request:
paths:
- 'Detection**'
- 'Solutions/**/Analytic Rules/**'
jobs:
checkCommentAlreadyExist:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.head.repo.fork }}
outputs:
hasAutoDetectionComment: ${{ steps.job1.outputs.hasAutoDetectionComment }}
steps:
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: Hello how are you I am GitHub bot
- id: job1
shell: pwsh
run: |
$commentId = ${{ steps.fc.outputs.comment-id }}
if ($commentId) {
Write-Output "hasAutoDetectionComment=$true" >> $env:GITHUB_OUTPUT
Write-Host "Comment Already Present!"
} else {
Write-Output "hasAutoDetectionComment=$false" >> $env:GITHUB_OUTPUT
Write-Host "Comment Not Present!"
}
add-comment:
needs: checkCommentAlreadyExist
if: ${{ success() && needs.checkCommentAlreadyExist.outputs.hasAutoDetectionComment == 'False' }}
uses: ./.github/workflows/addComment.yaml
with:
message: |
**Hello how are you I am GitHub bot**
😀😀
I see that you changed templates under the detections/analytic rules folder. Did you remember to update the version of the templates you changed?
If not, and if you want customers to be aware that a new version of this template is available, please update the ``version`` property of the template you changed.
prNumber: "${{ github.event.pull_request.number }}"
secrets: inherit