From e2bdefdf9a66042329436ed9188b9529465d17bf Mon Sep 17 00:00:00 2001 From: Dessa Date: Fri, 19 Jan 2024 19:43:43 +0100 Subject: [PATCH] chore: only run GitHub actions when on main account (#4433) the most prominent case being update-copyright-years-in-license-file altering commit history in forks depending on configuration (sometimes these type of PRs just auto-merge on forks, creating a merge conflict when they sync their fork for preparing a PR) additionally, some actions require secrets so they would fail anyway Co-authored-by: Daniel Gibbs --- .github/workflows/add-to-project.yml | 1 + .github/workflows/details-check.yml | 2 ++ .github/workflows/git-sync.yml | 1 + .github/workflows/labeler.yml | 2 ++ .github/workflows/lock.yml | 1 + .github/workflows/potential-duplicates.yml | 1 + .github/workflows/serverlist-validate.yml | 1 + .github/workflows/trigger-docker-build.yml | 2 ++ .github/workflows/update-check.yml | 1 + .github/workflows/update-copyright-years-in-license-file.yml | 1 + .github/workflows/version-check.yml | 1 + 11 files changed, 14 insertions(+) diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml index e429645bfe..0ddccb5729 100644 --- a/.github/workflows/add-to-project.yml +++ b/.github/workflows/add-to-project.yml @@ -7,6 +7,7 @@ on: jobs: add-to-project: + if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: Add to Project diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index ce9b459967..d940cfbc84 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -10,6 +10,7 @@ concurrency: jobs: create-matrix: + if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} @@ -28,6 +29,7 @@ jobs: echo -n "matrix=${shortnamearray}" >> $GITHUB_OUTPUT details-check: + if: github.repository_owner == 'GameServerManagers' needs: create-matrix continue-on-error: true runs-on: ubuntu-latest diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index 42ddd42e56..2f223f3705 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -9,6 +9,7 @@ on: jobs: gitHub-to-bitbucket: + if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: SSH Agent diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 24174fb229..b8bf630847 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -11,6 +11,7 @@ permissions: jobs: issue-labeler: + if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: Issue Labeler @@ -22,6 +23,7 @@ jobs: include-title: 1 is-sponsor-label: + if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: Is Sponsor Label diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index a4fdbf547c..ce00b840b3 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -9,6 +9,7 @@ permissions: jobs: lock: + if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: Lock Threads diff --git a/.github/workflows/potential-duplicates.yml b/.github/workflows/potential-duplicates.yml index 3c7f4334c4..ea0ba23fdd 100644 --- a/.github/workflows/potential-duplicates.yml +++ b/.github/workflows/potential-duplicates.yml @@ -5,6 +5,7 @@ on: - opened jobs: potential-duplicates: + if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: Potential Duplicates diff --git a/.github/workflows/serverlist-validate.yml b/.github/workflows/serverlist-validate.yml index 931329571c..f4a95a039d 100644 --- a/.github/workflows/serverlist-validate.yml +++ b/.github/workflows/serverlist-validate.yml @@ -5,6 +5,7 @@ on: jobs: serverlist-validate: + if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml index 61ec91d397..ae66542de9 100644 --- a/.github/workflows/trigger-docker-build.yml +++ b/.github/workflows/trigger-docker-build.yml @@ -6,6 +6,7 @@ on: jobs: trigger_build_docker-linuxgsm: + if: github.repository_owner == 'GameServerManagers' name: Trigger Build Docker LinuxGSM runs-on: ubuntu-latest steps: @@ -18,6 +19,7 @@ jobs: workflow_file_name: docker-publish.yml trigger_build_docker-gameserver: + if: github.repository_owner == 'GameServerManagers' name: Trigger Build Docker GameServer needs: trigger_build_docker-linuxgsm runs-on: ubuntu-latest diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index dfbc7dd580..b93fb2c471 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -10,6 +10,7 @@ concurrency: jobs: update-check: + if: github.repository_owner == 'GameServerManagers' continue-on-error: true runs-on: ubuntu-latest diff --git a/.github/workflows/update-copyright-years-in-license-file.yml b/.github/workflows/update-copyright-years-in-license-file.yml index 2d6d3eeeb2..3301c9cb73 100644 --- a/.github/workflows/update-copyright-years-in-license-file.yml +++ b/.github/workflows/update-copyright-years-in-license-file.yml @@ -6,6 +6,7 @@ on: jobs: update-license-year: + if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index a66eaca144..cfa7615bd7 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -7,6 +7,7 @@ permissions: jobs: version-Check: + if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: Checkout