From b71f0ddd5d2d346cb97b28fd3f70fef55bb9b6b7 Mon Sep 17 00:00:00 2001 From: Ryan Cohen Date: Sun, 3 Mar 2024 07:01:56 -0500 Subject: [PATCH] Prevent release-based Github Actions from running on forks (#340) * Prevent release-based Github Actions from running on forks Since release-based actions currently require @mortbopet's account details, these actions automatically fail when run on forks. These have been prevented in this commit by adding a conditional that runs them only for @mortbopet's repo. This could be expanded in the future so that forks can use their own account info to create releases. * Remove unnecessary conditionals --- .github/workflows/docker-deploy.yml | 1 + .github/workflows/release_setup.yml | 1 + .github/workflows/test.yml | 2 +- .github/workflows/wasm-release.yml | 3 ++- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-deploy.yml b/.github/workflows/docker-deploy.yml index bbe956a4b..9065fb459 100644 --- a/.github/workflows/docker-deploy.yml +++ b/.github/workflows/docker-deploy.yml @@ -7,6 +7,7 @@ on: jobs: docker: + if: github.repository == 'mortbopet/Ripes' runs-on: ubuntu-latest steps: - diff --git a/.github/workflows/release_setup.yml b/.github/workflows/release_setup.yml index fa4ddc1d4..af0b806e4 100644 --- a/.github/workflows/release_setup.yml +++ b/.github/workflows/release_setup.yml @@ -7,6 +7,7 @@ on: jobs: release-setup: + if: github.repository == 'mortbopet/Ripes' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8fed57b0..ab0def4ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: Ripes Tests on: push: branches: - - '*' + - '**' pull_request: jobs: diff --git a/.github/workflows/wasm-release.yml b/.github/workflows/wasm-release.yml index f7fc31022..677636054 100644 --- a/.github/workflows/wasm-release.yml +++ b/.github/workflows/wasm-release.yml @@ -2,7 +2,7 @@ name: WASM / Qt 6.6.0 on: push: branches: - - '*' + - '**' jobs: buildUbuntuXenial: @@ -103,5 +103,6 @@ jobs: # Dispatch the publish.yml workflow over at mortbopet.github.io - run: | gh workflow run publish.yml -R mortbopet/mortbopet.github.io --ref master + if: github.repository == 'mortbopet/Ripes' env: GH_TOKEN: ${{ secrets.MORTBOPET_GITHUB_IO_TOKEN }}