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