File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 push :
55 pull_request :
66
7+ permissions :
8+ contents : read
9+
710jobs :
811 build :
912 runs-on : ubuntu-latest
1013 steps :
1114 - uses : actions/checkout@v4
15+ with :
16+ persist-credentials : false
1217 - name : Install build tools
1318 run : >-
1419 sudo apt-get update --allow-releaseinfo-change &&
@@ -50,11 +55,13 @@ jobs:
5055 name : OpenFodder-linux-latest
5156 path : OpenFodder-linux-latest.zip
5257 - name : Discord notification
53- if : always() && env.DISCORD_WEBHOOK_URL != ' '
58+ if : always() && github.event_name == 'push' && github.ref == 'refs/heads/master '
5459 shell : pwsh
5560 env :
5661 DISCORD_WEBHOOK_URL : ${{ secrets.DISCORD_WEBHOOK_URL }}
5762 run : |
63+ if ([string]::IsNullOrWhiteSpace($env:DISCORD_WEBHOOK_URL)) { exit 0 }
64+
5865 $status = if ("${{ job.status }}" -eq "success") { "Success" } else { "Failure" }
5966 $color = if ("${{ job.status }}" -eq "success") { 3066993 } else { 15158332 }
6067 $title = "OpenFodder Ubuntu build $status"
You can’t perform that action at this time.
0 commit comments