-
Notifications
You must be signed in to change notification settings - Fork 3k
37 lines (35 loc) · 1.33 KB
/
addCommentOnPackagedPR.yaml
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
name: Add Comment on Packaged PR on Merge
on:
pull_request:
branches:
- master
paths:
- Solutions/**
types: [closed]
jobs:
if_merged:
if: ${{ github.event.pull_request.merged && !github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/github-script@29423367f079522048aa7c63f671593b0556ffd5
id: addComment
with:
script: |
const childPRDescription = context.payload.pull_request.body
if (childPRDescription != null && childPRDescription.includes('Automation have successfully generated package'))
{
// Add comment on packaged PR i.e. child PR
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "The solution package has now been merged into master. To make this package available on the Microsoft Sentinel Content hub, review the publishing guidance [here](https://github.com/Azure/Azure-Sentinel/tree/master/Solutions#step-3--publish-your-solution)"
})
}
else
{
console.log('Skipping addition of comment as PR is not an auto generated PR!')
}