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