Home > Software design >  Keeping main branches between fork and upstream repos different
Keeping main branches between fork and upstream repos different

Time:09-09

I want to keep certain GitHub workflows only in my fork.

For instance, I don't want to have .github/workflows/syncFork.yml file to be present in the upstream repo.

Is this possible in the long run?

I'm afraid ultimately, when I make PR to the original repo, it will contains this file anyway... so the best is to keep main branch between upstream and fork repos exactly the same. Right?

PS. I know I can disable workflow in the original repo:

jobs:
  sync:
    if
      github.repository == 'my-organization/repo'

CodePudding user response:

This is actually requested in discussion 9098 "Extend "on" with possibility to ignore forks (run only for the original repo) and vice versa", but not yet implemented.

The general idea would to have that workflow file in both repositories, but with a condition which test the repository name ("github.event.repository.name").

If said name if the original repository, the workflow would do nothing.

  • Related