@@ -14,7 +14,7 @@ permissions:
1414jobs :
1515 cleanup_old_runs :
1616 if : github.event.schedule == '0 13 * * *'
17- runs-on : ubuntu-20.04
17+ runs-on : ubuntu-latest
1818 permissions :
1919 actions : write
2020 env :
3333
3434 run_command :
3535 if : github.event.issue.pull_request != '' && contains(github.event.comment.body, '/run')
36- runs-on : ubuntu-20.04
36+ runs-on : ubuntu-latest
3737 steps :
3838 - name : Extract command to run
3939 uses : actions/github-script@v3
@@ -75,31 +75,40 @@ jobs:
7575 - name : Process fantomas command
7676 if : steps.command-extractor.outputs.result == 'fantomas'
7777 id : fantomas
78- run : dotnet fantomas . -r
79- - name : Process fantomas command
78+ run : dotnet fantomas .
79+ - name : Process xlf command
8080 if : steps.command-extractor.outputs.result == 'xlf'
8181 id : xlf
8282 run : dotnet build src/Compiler /t:UpdateXlf
83+
8384 - name : Commit and push changes
84- if : steps.fantomas.outcome == 'success' || steps.xlf.outcome == 'success'
85+ if : steps.fantomas.outcome == 'success' || steps.xlf.outcome == 'success' || steps.ilverify.outcome == 'success'
8586 run : |
87+ # Only commit if there are actual changes
88+ if git diff --quiet; then
89+ echo "No changes to commit, skipping."
90+ exit 0
91+ fi
92+
8693 git config --local user.name "github-actions[bot]"
8794 git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
8895 git commit -a -m 'Automated command ran: ${{ steps.command-extractor.outputs.result }}
8996
9097 Co-authored-by: ${{ github.event.comment.user.login }} <${{ github.event.comment.user.id }}+${{ github.event.comment.user.login }}@users.noreply.github.com>'
9198 git push
9299 - name : Post command comment
93- if : steps.fantomas.outcome == 'success' || steps.xlf.outcome == 'success'
100+ if : steps.fantomas.outcome == 'success' || steps.xlf.outcome == 'success' || steps.ilverify.outcome == 'success'
94101 uses : actions/github-script@v3
95102 with :
96103 script : |
97104 // Probably, there's more universal way of getting outputs, but my gh-actions-fu is not that good.
98105 var output = ""
99106 if ("${{steps.command-extractor.outputs.result}}" == 'fantomas') {
100107 output = "${{steps.fantomas.outputs.result}}"
101- } else if("${{steps.command-extractor.outputs.result}}" == 'xlf') {
108+ } else if ("${{steps.command-extractor.outputs.result}}" == 'xlf') {
102109 output = "${{steps.xlf.outputs.result}}"
110+ } else if ("${{steps.command-extractor.outputs.result}}" == 'ilverify') {
111+ output = "${{steps.ilverify.outputs.result}}"
103112 }
104113 const body = `Ran ${{ steps.command-extractor.outputs.result }}: https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}\n${output}`;
105114 await github.issues.createComment({
0 commit comments