Skip to content
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

[Feature]: Create GitHub Action to block PRs from ${fork}/main branch #2213

Closed
varshith257 opened this issue Mar 17, 2024 · 5 comments · Fixed by #2296
Closed

[Feature]: Create GitHub Action to block PRs from ${fork}/main branch #2213

varshith257 opened this issue Mar 17, 2024 · 5 comments · Fixed by #2296

Comments

@varshith257
Copy link
Contributor

Requirement

We should set up a new workflow that will fail if the PR is submitted from main branch. This workflow should be added to jearger/jarger-ui/documentation repositories (perhaps we need a reusable action - only if the check logic is reasonably complex).

Problem

Making PR changes on the main branch of a fork is a bad practice, and breaks some of our workflows that check if the current branch is main before doing certain steps (like trying to push to Docker).

Proposal

No response

Open questions

No response

@varshith257
Copy link
Contributor Author

@varshith257
Copy link
Contributor Author

@yurishkuro Here in this repo I can't find any GitHub actions. Should I add this functionality as a separate workflow in this repo?

@yurishkuro
Copy link
Member

you can refer to the action from the main repo and add it to lint workflow

@varshith257
Copy link
Contributor Author

you can refer to the action from the main repo and add it to lint workflow

@yurishkuro Can guide this how can we link with main repo action? So that it can be make ease for me to raise a PR. I tried it before when issue created but didn't get a work around solution

@yurishkuro
Copy link
Member

In the main repo we call the actions via relative path

    - name: Ensure PR is not on main branch
      uses: ./.github/actions/block-pr-not-on-main

In the other repos I think you can call the same action via full path jaegertracing/jaeger/.github/actions/block-pr-not-on-main@main

If that doesn't work for actions, it should definitely work for helper workflows according to the docs https://docs.github.com/en/actions/using-workflows/reusing-workflows#example-caller-workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants