Skip to content

Commit 49d5144

Browse files
heftymouseyaira2
authored andcommitted
GitHub: Updated formatting workflow messages (#15116)
1 parent 59e2158 commit 49d5144

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
@@ -10,6 +10,8 @@ jobs:
1010
defaults:
1111
run:
1212
shell: pwsh
13+
permissions:
14+
contents: write
1315

1416
steps:
1517
- name: Generate GitHub Apps token
@@ -34,7 +36,7 @@ jobs:
3436
run: |
3537
if (!(gh pr -R ${{ github.repository }} view ${{ github.event.issue.number }} --json maintainerCanModify -q '.maintainerCanModify' | ConvertFrom-Json))
3638
{
37-
gh pr comment ${{ github.event.issue.number }} -b "This PR cannot be committed to. Ensure that Allow edits from maintainers is enabled."
39+
gh pr comment ${{ github.event.issue.number }} -b "🔒 This PR cannot be committed to. Ensure that Allow edits from maintainers is enabled."
3840
"CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
3941
}
4042
@@ -67,7 +69,7 @@ jobs:
6769
$changedFiles = (git diff --name-only pr..$baseRef) -split "\n" | Where-Object {$_ -like "*.xaml"}
6870
if ($changedFiles.Count -eq 0)
6971
{
70-
gh pr comment ${{ github.event.issue.number }} -b "No XAML files found to format."
72+
gh pr comment ${{ github.event.issue.number }} -b "No XAML files found to format."
7173
"CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
7274
}
7375
@@ -86,7 +88,7 @@ jobs:
8688
git status --porcelain
8789
if ((git status --porcelain) -eq $null)
8890
{
89-
gh pr comment ${{ github.event.issue.number }} -b "No XAML files changed."
91+
gh pr comment ${{ github.event.issue.number }} -b "No XAML files changed."
9092
"CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
9193
}
9294
else
@@ -124,7 +126,7 @@ jobs:
124126
125127
if ($LASTEXITCODE -eq 0)
126128
{
127-
gh pr comment ${{ github.event.issue.number }} -b "Successfully formatted XAML files."
129+
gh pr comment ${{ github.event.issue.number }} -b "Successfully formatted XAML files."
128130
}
129131
else
130132
{
@@ -133,5 +135,5 @@ jobs:
133135
continue-on-error: true
134136

135137
- name: Comment if failed
136-
if: failure() && env.CAN_RUN == 1
137-
run: gh pr comment ${{ github.event.issue.number }} -b "Failed to format XAML files, check logs for more information."
138+
if: failure() && env.CAN_RUN == 0
139+
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)