Skip to content

Commit e8c6867

Browse files
authored
Update linux-build.yml
1 parent b94fad2 commit e8c6867

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/linux-build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ on:
44
push:
55
pull_request:
66

7+
permissions:
8+
contents: read
9+
710
jobs:
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"

0 commit comments

Comments
 (0)