1111 defaults :
1212 run :
1313 shell : pwsh
14+ permissions :
15+ contents : write
1416
1517 steps :
1618 - name : Generate GitHub Apps token
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
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
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