Skip to content

Commit

Permalink
Adjust notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhwhite committed Feb 27, 2025
1 parent 8a2c2d6 commit b02b610
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automated-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
MSG_MINIMAL: 'true'

- name: Notify Slack for fails
if: ${{ failure() }}
if: ${{ failure() || steps.sync.outputs.success != 'true' }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Expand Down
24 changes: 19 additions & 5 deletions scripts/automated-translations.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ if (-not $TempPath -or -not (Test-Path -Path $TempPath -PathType Container))
$IsDryRunBool = [System.Convert]::ToBoolean("$IsDryRun")

$CommitMessage = "chore: update library resources"
$GitUser = "user.name=blackbaud-sky-build-user"
$GitEmail = "user.email=[email protected]"
$GitUser = "blackbaud-sky-build-user"
$GitEmail = "[email protected]"
$GitRepo = "blackbaud/skyux"
$GitUsername = gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /user --jq=.login
$TranslationBranchName = "automated-translations"
Expand Down Expand Up @@ -63,6 +63,10 @@ if (-not $remoteBranchExists)
git push origin $TranslationBranchName
}
Write-Output "`n::endgroup::`n"
if ($env:GITHUB_OUTPUT)
{
Write-Output "success=true" >> $env:GITHUB_OUTPUT
}
}
else
{
Expand Down Expand Up @@ -143,7 +147,7 @@ else
if ($changesFromLts)
{
Write-Output "`n::group::Pull request`n"
$prForChanges = gh pr list --json title,url,headRefName --jq ".[] | select(.headRefName == `"${LtsBranchName}`")"
$prForChanges = gh pr list --json title,url,headRefName --jq ".[] | select(.headRefName == `"${TranslationBranchName}`")"
if ($prForChanges)
{
if ($env:GITHUB_OUTPUT)
Expand All @@ -157,8 +161,10 @@ else
Write-Output "`n# gh pr create --base $LtsBranchName --head $TranslationBranchName --title '${CommitMessage}'"
gh pr create --base $LtsBranchName --head $TranslationBranchName `
--title "${CommitMessage}" `
--body ":robot: This pull request was created by the automated translations script."
$prForChanges = gh pr list --json title,url,headRefName --jq ".[] | select(.headRefName == `"${LtsBranchName}`")"
--body ":robot: This pull request was created by the automated translations script." `
--label "risk level (author): 1" `
--label "skip e2e"
$prForChanges = gh pr list --json title,url,headRefName --jq ".[] | select(.headRefName == `"${TranslationBranchName}`")"
if ($env:GITHUB_OUTPUT)
{
Write-Output "prCreated=true" >> $env:GITHUB_OUTPUT
Expand All @@ -170,6 +176,10 @@ else
{
Write-Output "prTitle=$($pr.title)" >> $env:GITHUB_OUTPUT
Write-Output "prUrl=$($pr.url)" >> $env:GITHUB_OUTPUT
if ($pr.url)
{
Write-Output "success=true" >> $env:GITHUB_OUTPUT
}
}
Write-Output "`n::endgroup::`n"
}
Expand All @@ -178,5 +188,9 @@ else
Write-Output "`n::group::No pull request`n"
Write-Output "`n➡︎ No changes to merge to $LtsBranchName branch from $TranslationBranchName branch.`n"
Write-Output "`n::endgroup::`n"
if ($env:GITHUB_OUTPUT)
{
Write-Output "success=true" >> $env:GITHUB_OUTPUT
}
}
}

0 comments on commit b02b610

Please sign in to comment.