[llvm] [Github] Only run github actions on main monorepo (PR #69774)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 13:34:05 PDT 2023


https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/69774

There are currently a couple jobs that run on all forks of LLVM too (if there is a PR opened, or in the case of the documentation builds, upon pushing to main). This isn't desired behavior. This commit disables that behavior, forcing the jobs to not run if they aren't running against llvm/llvm-project or a PR against that repo.

>From 0dda836ae58d2df9159698c69af72bb6b5dc7edc Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Fri, 20 Oct 2023 13:27:19 -0700
Subject: [PATCH] [Github] Only run github actions on main monorepo

There are currently a couple jobs that run on all forks of LLVM too (if
there is a PR opened, or in the case of the documentation builds, upon
pushing to main). This isn't desired behavior. This commit disables that
behavior, forcing the jobs to not run if they aren't running against
llvm/llvm-project or a PR against that repo.
---
 .github/workflows/docs.yml           | 1 +
 .github/workflows/pr-code-format.yml | 1 +
 2 files changed, 2 insertions(+)

diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index d58c7d51e0e44ab..cea622d11168bd9 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -24,6 +24,7 @@ jobs:
   check-docs-build:
     name: "Test documentation build"
     runs-on: ubuntu-latest
+    if: github.repository == 'llvm/llvm-project'
     steps:
       - name: Fetch LLVM sources
         uses: actions/checkout at v4
diff --git a/.github/workflows/pr-code-format.yml b/.github/workflows/pr-code-format.yml
index 3a91ffb0b1ad9a7..846f515c312a7f9 100644
--- a/.github/workflows/pr-code-format.yml
+++ b/.github/workflows/pr-code-format.yml
@@ -6,6 +6,7 @@ permissions:
 jobs:
   code_formatter:
     runs-on: ubuntu-latest
+    if: github.repository == 'llvm/llvm-project'
     steps:
       - name: Fetch LLVM sources
         uses: actions/checkout at v4



More information about the llvm-commits mailing list