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

fix(github): Allow status check/command requirements to work on fork PRs #3620

Merged
merged 6 commits into from
Aug 1, 2023

Conversation

ttretau
Copy link
Contributor

@ttretau ttretau commented Jul 24, 2023

what

Fix #2601 by using the owner of PRs head in the Github API status check.

why

As described in #2601, currently the status check fails on forked repo PRs (with a 404) due to using the repo owner, which will only work on Github PRs on the same repo. This change will make it also work in case of a forked repo.

tests

  • Adapted unit tests.
  • Running the patched version in integration and production Atlantis instance successfully.

references

closes #2601

ttretau and others added 3 commits May 25, 2023 10:43
While using a PR from a fork and the "Github allow mergeable bypass apply" flag, the mergeable checks were run with the wrong owner in the request, leading to 404. By choosing the owner from the head repo data it should work both, for fork PRs and in-repo PRs.
@ttretau ttretau requested a review from a team as a code owner July 24, 2023 14:29
@github-actions github-actions bot added go Pull requests that update Go code provider/github labels Jul 24, 2023
@GenPage GenPage enabled auto-merge (squash) August 1, 2023 01:56
@GenPage GenPage merged commit 6227195 into runatlantis:main Aug 1, 2023
12 checks passed
ijames-gc pushed a commit to gocardless/atlantis that referenced this pull request Feb 13, 2024
While using a PR from a fork and the "Github allow mergeable bypass apply" flag, the mergeable checks were run with the wrong owner in the request, leading to 404. By choosing the owner from the head repo data it should work both, for fork PRs and in-repo PRs.

Co-authored-by: Dylan Page <[email protected]>
ijames-gc pushed a commit to gocardless/atlantis that referenced this pull request Feb 13, 2024
While using a PR from a fork and the "Github allow mergeable bypass apply" flag, the mergeable checks were run with the wrong owner in the request, leading to 404. By choosing the owner from the head repo data it should work both, for fork PRs and in-repo PRs.

Co-authored-by: Dylan Page <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code provider/github
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"GitHub Allow Mergable Bypass Apply" Broken for Fork PRs
2 participants