Enable deployments from PR from the same repository only

ahl's Avatar


09 Feb, 2023 02:55 PM

A few questions:

1. Wouldn't it be safe to have a setting for "Enable deployments in Pull Requests from the same repository only"? As opposed to "Enable deployments in Pull Requests (available for private repos)".

2. Is there a way to deploy Pull Requests when they are from the same repository?

3. Is there a environment variable to see if current build is a PR from same repository?

Hope you can help! :)

  1. Support Staff 1 Posted by Feodor Fitsner on 09 Feb, 2023 06:04 PM

    Feodor Fitsner's Avatar

    Both secure variables and deployments are allowed in PR builds of private repositories.

    Could you please elaborate what are you trying to accomplish: being able to deploy in PR builds of public project?

  2. 2 Posted by ahl on 09 Feb, 2023 06:39 PM

    ahl's Avatar

    Yes, this is a public repo that receives PRs from both repo owners and
    external collaborators.

    For internal PRs (that are from branches on the main “fork”) I’d like to
    deploy packages to internal nuget servers. For external PRs I’d like to
    just build and test.


    On February 9, 2023, Feodor Fitsner <[email blocked]>

  3. Support Staff 3 Posted by Feodor Fitsner on 09 Feb, 2023 06:53 PM

    Feodor Fitsner's Avatar

    OK, so there is no way to run a built-in deployment in a PR build of public repository.

    However, you can implement your own publishing (nuget publish ...), put NuGet API key to a "secure variable" and then enable "Enable secure variables in Pull Requests from the same repository only".

    To check during the build if it's a PR build from the same repo or a fork you can just check the value of secure variable with Nuget API key, right? If it's set - the same repo, if it's empty - fork.

    Hope that helps.

  4. Feodor Fitsner closed this discussion on 11 Apr, 2023 09:03 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac