11
11
defaults :
12
12
run :
13
13
shell : pwsh
14
+ permissions :
15
+ contents : write
14
16
15
17
steps :
16
18
- name : Generate GitHub Apps token
35
37
run : |
36
38
if (!(gh pr -R ${{ github.repository }} view ${{ github.event.issue.number }} --json maintainerCanModify -q '.maintainerCanModify' | ConvertFrom-Json))
37
39
{
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."
39
41
"CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
40
42
}
41
43
68
70
$changedFiles = (git diff --name-only pr..$baseRef) -split "\n" | Where-Object {$_ -like "*.xaml"}
69
71
if ($changedFiles.Count -eq 0)
70
72
{
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."
72
74
"CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
73
75
}
74
76
87
89
git status --porcelain
88
90
if ((git status --porcelain) -eq $null)
89
91
{
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."
91
93
"CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
92
94
}
93
95
else
@@ -125,7 +127,7 @@ jobs:
125
127
126
128
if ($LASTEXITCODE -eq 0)
127
129
{
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."
129
131
}
130
132
else
131
133
{
@@ -134,5 +136,5 @@ jobs:
134
136
continue-on-error : true
135
137
136
138
- 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