Skip to content

Have github action only run on master repo, and not on forks? #26409

Answered by s-weigand
Blakeinstein asked this question in Actions
Discussion options

You must be logged in to vote

@Simran-B gave the solution you want and need 😉

To make the condition more portable (copy/paste) in an organization or your own account you can just use the repository owner name as a condition to match.

In your case just replace

github.com

Upvision/upvision.github.io/blob/41ac1a284e4b3accc09309d852ca3b477d1f395e/.github/workflows/gh-deploy.yml#L10-L11

  1. jobs:
  2. publish:

with

jobs:
  publish:
    if: github.repository_owner == 'Upvision'

For the forks not to be bothered with the failing workflow they just need to update to your version.

Replies: 21 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@kingthorin
Comment options

@devedse
Comment options

Comment options

You must be logged in to vote
2 replies
@thbeu
Comment options

@jsoref
Comment options

Comment options

You must be logged in to vote
1 reply
@jsoref
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product Feedback Share your thoughts and suggestions on GitHub features and improvements
10 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy