Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
value: ${{ vars.AUTOMATION_EMAIL }}
application-name:
value: ${{ vars.AUTOMATION_APPLICATION_NAME }}
application-login:
value: ${{ vars.AUTOMATION_APPLICATION_LOGIN }}
application-username:
value: ${{ vars.AUTOMATION_APPLICATION_USERNAME }}
secrets:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
env:
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
EXPECTED_PR_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-name }}
EXPECTED_COMMENT_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-login }}
COMMENT_USER_NAME: ${{ github.event.comment.user.login }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
NUGET_TOKEN: ${{ steps.nuget-login.outputs.NUGET_API_KEY }}
Expand All @@ -81,6 +82,7 @@ jobs:
-gitRepository ${env:GITHUB_REPOSITORY} `
-pullRequestNumber ${env:ISSUE_NUMBER} `
-expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME} `
-expectedCommentAuthorUserName ${env:EXPECTED_COMMENT_AUTHOR_USER_NAME} `
-commentUserName ${env:COMMENT_USER_NAME} `
-artifactDownloadPath "${env:GITHUB_WORKSPACE}/artifacts" `
-pushToNuget $HasToken
Expand Down Expand Up @@ -153,11 +155,13 @@ jobs:
env:
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
EXPECTED_PR_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-name }}
EXPECTED_COMMENT_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-login }}
TAG: ${{ inputs.tag || github.ref_name }}
run: |
Import-Module .\build\scripts\post-release.psm1

TryPostReleasePublishedNoticeOnPrepareReleasePullRequest `
-gitRepository ${env:GITHUB_REPOSITORY} `
-expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME} `
-expectedCommentAuthorUserName ${env:EXPECTED_COMMENT_AUTHOR_USER_NAME} `
-tag ${env:TAG}
4 changes: 3 additions & 1 deletion .github/workflows/publish-packages-1.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ jobs:
env:
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
EXPECTED_PR_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-name }}
EXPECTED_COMMENT_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-login }}
PACKAGES_URL: ${{ needs.build-pack-publish.outputs.artifact-url }}
run: |
Import-Module .\build\scripts\post-release.psm1
Expand All @@ -236,4 +237,5 @@ jobs:
-tag ${env:GITHUB_REF_NAME} `
-tagSha ${env:GITHUB_SHA} `
-packagesUrl ${env:PACKAGES_URL} `
-expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME}
-expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME} `
-expectedCommentAuthorUserName ${env:EXPECTED_COMMENT_AUTHOR_USER_NAME}
11 changes: 7 additions & 4 deletions build/scripts/post-release.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ function TryPostPackagesReadyNoticeOnPrepareReleasePullRequest {
[Parameter(Mandatory=$true)][string]$tag,
[Parameter(Mandatory=$true)][string]$tagSha,
[Parameter(Mandatory=$true)][string]$packagesUrl,
[Parameter(Mandatory=$true)][string]$expectedPrAuthorUserName
[Parameter(Mandatory=$true)][string]$expectedPrAuthorUserName,
[Parameter(Mandatory=$true)][string]$expectedCommentAuthorUserName
)

$prListResponse = gh pr list --search $tagSha --state merged --json number,author,title,comments | ConvertFrom-Json
Expand All @@ -146,7 +147,7 @@ function TryPostPackagesReadyNoticeOnPrepareReleasePullRequest {
$foundComment = $false
foreach ($comment in $pr.comments)
{
if ($comment.author.login -eq $expectedPrAuthorUserName -and $comment.body.StartsWith("I just pushed the [$tag]"))
if ($comment.author.login -eq $expectedCommentAuthorUserName -and $comment.body.StartsWith("I just pushed the [$tag]"))
{
$foundComment = $true
break
Expand Down Expand Up @@ -181,6 +182,7 @@ function PushPackagesPublishReleaseUnlockAndPostNoticeOnPrepareReleasePullReques
[Parameter(Mandatory=$true)][string]$gitRepository,
[Parameter(Mandatory=$true)][string]$pullRequestNumber,
[Parameter(Mandatory=$true)][string]$expectedPrAuthorUserName,
[Parameter(Mandatory=$true)][string]$expectedCommentAuthorUserName,
[Parameter(Mandatory=$true)][string]$commentUserName,
[Parameter(Mandatory=$true)][string]$artifactDownloadPath,
[Parameter(Mandatory=$true)][bool]$pushToNuget
Expand Down Expand Up @@ -215,7 +217,7 @@ function PushPackagesPublishReleaseUnlockAndPostNoticeOnPrepareReleasePullReques
$packagesUrl = ''
foreach ($comment in $prViewResponse.comments)
{
if ($comment.author.login -eq $expectedPrAuthorUserName -and $comment.body.StartsWith("The packages for [$tag](https://github.com/$gitRepository/releases/tag/$tag) are now available:"))
if ($comment.author.login -eq $expectedCommentAuthorUserName -and $comment.body.StartsWith("The packages for [$tag](https://github.com/$gitRepository/releases/tag/$tag) are now available:"))
{
$foundComment = $true
break
Expand Down Expand Up @@ -550,6 +552,7 @@ function TryPostReleasePublishedNoticeOnPrepareReleasePullRequest {
param(
[Parameter(Mandatory=$true)][string]$gitRepository,
[Parameter(Mandatory=$true)][string]$expectedPrAuthorUserName,
[Parameter(Mandatory=$true)][string]$expectedCommentAuthorUserName,
[Parameter(Mandatory=$true)][string]$tag
)

Expand Down Expand Up @@ -577,7 +580,7 @@ function TryPostReleasePublishedNoticeOnPrepareReleasePullRequest {
$foundComment = $false
foreach ($comment in $pr.comments)
{
if ($comment.author.login -eq $expectedPrAuthorUserName -and $comment.body.StartsWith("The packages for [$tag](https://github.com/$gitRepository/releases/tag/$tag) are now available:"))
if ($comment.author.login -eq $expectedCommentAuthorUserName -and $comment.body.StartsWith("The packages for [$tag](https://github.com/$gitRepository/releases/tag/$tag) are now available:"))
{
$foundComment = $true
break
Expand Down
Loading