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

Create Pull Request from Forked Repo #27

Open
lampajr opened this issue Jan 10, 2023 · 5 comments
Open

Create Pull Request from Forked Repo #27

lampajr opened this issue Jan 10, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@lampajr
Copy link
Member

lampajr commented Jan 10, 2023

Give the possibility to open the backporting pull request from the forked repository, obviously in this case we assume the provided token has proper permissions on the forked repository.

Steps need:

  • Parameterize this new feature, by default create PR from target repo
  • If this new feature is enabled:
    • Add new remote
    • Push branch to this remote
    • Create pr setting head has <fork-owner>:<branch-name>
@lampajr lampajr added the enhancement New feature or request label Jan 10, 2023
@earl-warren
Copy link
Contributor

This helps reduce the risk to the target repository if the token is leaked: it does not need permission to write.

@lampajr
Copy link
Member Author

lampajr commented Mar 23, 2024

This helps reduce the risk to the target repository if the token is leaked: it does not need permission to write.

I definitely agree with you!
Is this something you'd be willing to submit a pull request for? Otherwise I can try to find some time to work on this in the coming week.

@lampajr lampajr self-assigned this Mar 30, 2024
@lampajr
Copy link
Member Author

lampajr commented Mar 30, 2024

After some further investigation, I think that this feature would make sense only for those users that actually run the tool as CLI, i.e., providing their own GITHUB_TOKEN.

Whereas, in GitHub action context, the action is always run using the repository GITHUB_TOKEN (or any other PAT created in that repo) which does not have any rights to push new branches into the forked repository making this feature quite useless for GitHub action scenarios.

@earl-warren
Copy link
Contributor

Except when a PAT with proper permissions is provided with auth. A Forgejo Action does this to cascade pull requests between repositories:

The key here is that the PAT has no write access to the destination repository, only to the repository from which the pull request will be made, which is better from a security perspective.

@lampajr
Copy link
Member Author

lampajr commented Mar 31, 2024

That's interesting, thanks for sharing this 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants