[Github] Add repository checks to release-binaries workflow (#84437)
authorAiden Grossman <agrossman154@yahoo.com>
Fri, 8 Mar 2024 08:13:11 +0000 (00:13 -0800)
committerTom Stellard <tstellar@redhat.com>
Thu, 9 May 2024 02:47:50 +0000 (19:47 -0700)
This patch adds repository checks to the release-binaries workflow jobs.
People were observing that the job was running on a schedule in their
forks. This only happens on old forks, but those probably exist in great
number given how prolific LLVM is. This is also good practice anyways,
on top of solving the direct problem of these jobs running with the cron
schedule on people's forks.

(cherry picked from commit 9f5be5f0092a636274953389cd5771c45ac0a568)

.github/workflows/release-binaries.yml

index ebf6fa41898dc40d85018496faaabf6ae2193da5..e487b0f1d4b5d6541de7c5079ee9378652a06a6f 100644 (file)
@@ -35,6 +35,7 @@ jobs:
   prepare:
     name: Prepare to build binaries
     runs-on: ubuntu-22.04
+    if: github.repository == 'llvm/llvm-project'
     outputs:
       release-version: ${{ steps.vars.outputs.release-version }}
       flags: ${{ steps.vars.outputs.flags }}
@@ -85,6 +86,7 @@ jobs:
     name: "Fill Cache ${{ matrix.os }}"
     needs: prepare
     runs-on: ${{ matrix.os }}
+    if: github.repository == 'llvm/llvm-project'
     strategy:
       matrix:
         os:
@@ -119,6 +121,7 @@ jobs:
       - prepare
       - fill-cache
     runs-on: ${{ matrix.target.runs-on }}
+    if: github.repository == 'llvm/llvm-project'
     strategy:
       fail-fast: false
       matrix: