You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$message="Created task-lib localization update PR. Someone please approve/merge it. :please-puss-in-boots: $env:PR_LINK"
100
-
$body = [PSCustomObject]@{
101
-
text = $message
102
-
} | ConvertTo-Json
103
-
104
-
Invoke-RestMethod -Uri $(slackUri) -Method Post -Body $body -ContentType 'application/json'
105
-
displayName: 'Send Slack notification about PR opened'
98
+
# Two next tasks are used to notify about Localization update PRs
99
+
# Notifications are set by POST method to MS Teams webhook
100
+
# Body of message is compiled as Office 365 connector card
101
+
# More details about cards - https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-reference#office-365-connector-card
Copy file name to clipboardExpand all lines: open-pullrequest.ps1
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ param(
4
4
$SourceBranch
5
5
)
6
6
7
+
# Getting a created PR. Result object has interface in accordance with article https://docs.github.com/en/rest/reference/pulls#get-a-pull-request
7
8
functionGet-PullRequest() {
8
-
$prInfo= (gh api -X GET repos/:owner/:repo/pulls -F head=":owner:$SourceBranch"-f state=open -f base=master |ConvertFrom-Json)
9
-
return$prInfo.html_url
9
+
return (gh api -X GET repos/:owner/:repo/pulls -F head=":owner:$SourceBranch"-f state=open -f base=master |ConvertFrom-Json)
10
10
}
11
11
12
12
$openedPR=Get-PullRequest
13
13
14
-
if ($openedPR.length-ne0) {
14
+
if ($openedPR.html_url.length-ne0) {
15
15
throw"A PR from $SourceBranch to master already exists."
16
16
}
17
17
@@ -20,6 +20,10 @@ $body = "This PR was auto-generated with [the localization pipeline build]($buil
0 commit comments