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

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 13:37:53 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-github-workflow

Author: Aiden Grossman (boomanaiden154)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/69774.diff


2 Files Affected:

- (modified) .github/workflows/docs.yml (+1) 
- (modified) .github/workflows/pr-code-format.yml (+1) 


``````````diff
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

``````````

</details>


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


More information about the llvm-commits mailing list