From cfd28e8feb7e90161cb905ba6746c50ba3e96b14 Mon Sep 17 00:00:00 2001 From: Konicai <71294714+Konicai@users.noreply.github.com> Date: Sat, 18 Feb 2023 04:46:44 -0500 Subject: [PATCH] Only publish and notify Discord on push if running inside this repository (#387) * Only attempt publishing if running in GeyserMC/Floodgate * Also restrict the discord notification --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40edc4fd..b67afb27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: arguments: build - name: Publish to Maven Repository - if: ${{ job.status == 'success' }} + if: ${{ job.status == 'success' && github.repository == 'GeyserMC/Floodgate' }} uses: gradle/gradle-build-action@v2 env: ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }} @@ -32,7 +32,7 @@ jobs: arguments: publish - name: Publish to Downloads API - if: ${{ github.ref_name == 'master' && job.status == 'success' }} + if: ${{ github.ref_name == 'master' && job.status == 'success' && github.repository == 'GeyserMC/Floodgate' }} shell: bash run: | # Save the private key to a file @@ -52,6 +52,7 @@ jobs: ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP ./handleBuild.sh floodgate $version $GITHUB_RUN_ID $GITHUB_SHA - name: Notify Discord + if: ${{ github.repository == 'GeyserMC/Floodgate' }} uses: Tim203/actions-git-discord-webhook@main with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }}