Skip to content

workflows/release-binaries: Restrict jobs based on owner instead of repo #123797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

tstellar
Copy link
Collaborator

Not really any functional change, just a clean up that could make it easier to share snippets with other repos.

Not really any functional change, just a clean up that could make it
easier to share snippets with other repos.
@llvmbot
Copy link
Member

llvmbot commented Jan 21, 2025

@llvm/pr-subscribers-github-workflow

Author: Tom Stellard (tstellar)

Changes

Not really any functional change, just a clean up that could make it easier to share snippets with other repos.


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

1 Files Affected:

  • (modified) .github/workflows/release-binaries.yml (+3-3)
diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml
index 29be8195da68ac..f9a264e7cf48f1 100644
--- a/.github/workflows/release-binaries.yml
+++ b/.github/workflows/release-binaries.yml
@@ -49,7 +49,7 @@ jobs:
   prepare:
     name: Prepare to build binaries
     runs-on: ${{ inputs.runs-on }}
-    if: github.repository == 'llvm/llvm-project'
+    if: github.repository_owner == 'llvm'
     outputs:
       release-version: ${{ steps.vars.outputs.release-version }}
       ref: ${{ steps.vars.outputs.ref }}
@@ -177,7 +177,7 @@ jobs:
   build-release-package:
     name: "Build Release Package"
     needs: prepare
-    if: github.repository == 'llvm/llvm-project'
+    if: github.repository_owner == 'llvm'
     runs-on: ${{ needs.prepare.outputs.build-runs-on }}
     steps:
 
@@ -327,7 +327,7 @@ jobs:
       - prepare
       - build-release-package
     if: >-
-      github.repository == 'llvm/llvm-project'
+      github.repository_owner == 'llvm'
     runs-on: ${{ needs.prepare.outputs.test-runs-on }}
     steps:
     - name: Checkout Actions

Copy link
Contributor

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an intention to use this or is this just general cleanup?

Anyways, LGTM.

@tstellar
Copy link
Collaborator Author

@boomanaiden154 It was a cleanup suggested here: #120786 (comment)

I also prefer this, because I think it looks better. Eventually I want to add a style guide for workflows that included things like this so we can be consistent.

@boomanaiden154
Copy link
Contributor

I also prefer this, because I think it looks better. Eventually I want to add a style guide for workflows that included things like this so we can be consistent.

Makes sense to me. I've been meaning to write up something like that too, but haven't gotten around to it. Will happily review if you get to it before me.

@tstellar tstellar merged commit 8f45452 into llvm:main Jan 23, 2025
18 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants