Skip to content

Commit cce6d58

Browse files
authored
GitHub: Updated formatting workflow messages (#15116)
1 parent bfca21c commit cce6d58

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/format-xaml.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
defaults:
1212
run:
1313
shell: pwsh
14+
permissions:
15+
contents: write
1416

1517
steps:
1618
- name: Generate GitHub Apps token
@@ -35,7 +37,7 @@ jobs:
3537
run: |
3638
if (!(gh pr -R ${{ github.repository }} view ${{ github.event.issue.number }} --json maintainerCanModify -q '.maintainerCanModify' | ConvertFrom-Json))
3739
{
38-
gh pr comment ${{ github.event.issue.number }} -b "This PR cannot be committed to. Ensure that Allow edits from maintainers is enabled."
40+
gh pr comment ${{ github.event.issue.number }} -b "🔒 This PR cannot be committed to. Ensure that Allow edits from maintainers is enabled."
3941
"CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
4042
}
4143
@@ -68,7 +70,7 @@ jobs:
6870
$changedFiles = (git diff --name-only pr..$baseRef) -split "\n" | Where-Object {$_ -like "*.xaml"}
6971
if ($changedFiles.Count -eq 0)
7072
{
71-
gh pr comment ${{ github.event.issue.number }} -b "No XAML files found to format."
73+
gh pr comment ${{ github.event.issue.number }} -b "No XAML files found to format."
7274
"CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
7375
}
7476
@@ -87,7 +89,7 @@ jobs:
8789
git status --porcelain
8890
if ((git status --porcelain) -eq $null)
8991
{
90-
gh pr comment ${{ github.event.issue.number }} -b "No XAML files changed."
92+
gh pr comment ${{ github.event.issue.number }} -b "No XAML files changed."
9193
"CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
9294
}
9395
else
@@ -125,7 +127,7 @@ jobs:
125127
126128
if ($LASTEXITCODE -eq 0)
127129
{
128-
gh pr comment ${{ github.event.issue.number }} -b "Successfully formatted XAML files."
130+
gh pr comment ${{ github.event.issue.number }} -b "Successfully formatted XAML files."
129131
}
130132
else
131133
{
@@ -134,5 +136,5 @@ jobs:
134136
continue-on-error: true
135137

136138
- name: Comment if failed
137-
if: failure() && env.CAN_RUN == 1
138-
run: gh pr comment ${{ github.event.issue.number }} -b "Failed to format XAML files, check logs for more information."
139+
if: failure() && env.CAN_RUN == 0
140+
run: gh pr comment ${{ github.event.issue.number }} -b "⚠️ Failed to format XAML files, check [the logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more information."

0 commit comments

Comments
 (0)