Parcourir la source

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 <me@danielgibbs.co.uk>
Dessa il y a 2 ans
Parent
commit
e2bdefdf9a

+ 1 - 0
.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

+ 2 - 0
.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

+ 1 - 0
.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

+ 2 - 0
.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

+ 1 - 0
.github/workflows/lock.yml

@@ -9,6 +9,7 @@ permissions:
 
 jobs:
   lock:
+    if: github.repository_owner == 'GameServerManagers'
     runs-on: ubuntu-latest
     steps:
       - name: Lock Threads

+ 1 - 0
.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

+ 1 - 0
.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

+ 2 - 0
.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

+ 1 - 0
.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
 

+ 1 - 0
.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

+ 1 - 0
.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