1313 shell : pwsh
1414 permissions :
1515 contents : write
16+ environment : Pull Requests
1617
1718 steps :
1819 - name : Generate GitHub Apps token
3738 run : |
3839 if (!(gh pr -R ${{ github.repository }} view ${{ github.event.issue.number }} --json maintainerCanModify -q '.maintainerCanModify' | ConvertFrom-Json))
3940 {
40- gh pr comment ${{ github.event.issue.number }} -b "This PR cannot be committed to. Ensure that Allow edits from maintainers is enabled."
41+ gh pr comment ${{ github.event.issue.number }} -b "🔒 This PR cannot be committed to. Ensure that Allow edits from maintainers is enabled."
4142 "CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
4243 }
4344
7071 $changedFiles = (git diff --name-only pr..$baseRef) -split "\n" | Where-Object {$_ -like "*.xaml"}
7172 if ($changedFiles.Count -eq 0)
7273 {
73- gh pr comment ${{ github.event.issue.number }} -b "No XAML files found to format."
74+ gh pr comment ${{ github.event.issue.number }} -b "⛔ No XAML files found to format."
7475 "CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
7576 }
7677
8990 git status --porcelain
9091 if ((git status --porcelain) -eq $null)
9192 {
92- gh pr comment ${{ github.event.issue.number }} -b "No XAML files changed."
93+ gh pr comment ${{ github.event.issue.number }} -b "⛔ No XAML files changed."
9394 "CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
9495 }
9596 else
@@ -127,7 +128,7 @@ jobs:
127128
128129 if ($LASTEXITCODE -eq 0)
129130 {
130- gh pr comment ${{ github.event.issue.number }} -b "Successfully formatted XAML files."
131+ gh pr comment ${{ github.event.issue.number }} -b "✅ Successfully formatted XAML files."
131132 }
132133 else
133134 {
@@ -136,5 +137,5 @@ jobs:
136137 continue-on-error : true
137138
138139 - name : Comment if failed
139- if : failure() && env.CAN_RUN == 1
140- run : gh pr comment ${{ github.event.issue.number }} -b "Failed to format XAML files, check logs for more information."
140+ if : failure() && env.CAN_RUN == 0
141+ 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