Different Job Secret for Different Branch
Define multiple secrets with the same name to select a value according to job authorization. OneDev uses the first authorized secret with that name, searching the current project before its parents.
Configure the Secrets
Open the project's Settings > Build > Job Secrets.
- Add a secret named
deploymentwith the production value and authorizationon branch "main". - After it, add another secret also named
deploymentwith the development value and authorizationon branch "**". - Keep the main-branch entry first. Reference
@secret:deployment@in the job wherever the selected value is needed.

The default branch authorization is on branch "**"; leaving authorization completely empty is different, as it also permits jobs triggered through external pull requests. Choose the authorization appropriate for your workflow.
Verify Selection
Use disposable test values first. Run the job on a commit reachable from main, then on a feature-branch commit that has not been merged into main. The first run should receive the main entry; the second should receive the fallback entry. Check the value with a command that reports only whether the expected value matched, rather than printing a real secret.
Authorization considers whether the build commit is reachable from the named branch. A commit already merged into main can therefore use the main-branch secret even when another branch also points to it.