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