Azure / Azure/azure-devops-cli-extension
[Feature Request] Support for setting "Make secrets available to builds of forks" pipeline property
- Dominant language
- Python
- Stars
- 682
- Forks
- 278
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 3
Description
When you use:
```
az pipelines create ... --repository-type github
```
to create a build pipeline, by default the following properties are set for the "Pull Request Validation" trigger, as per:
```
az pipelines build definition show --name my_pipeline_name
```
"triggers": [
{
"branchFilters": [],
"forks": {
"allowSecrets": false,
"enabled": true
},
...
"triggerType": "pullRequest"
}
There are cases where you might want to enable "allowSecrets" to be enabled, currently the only way to do this seems to be via the GUI, selecting the "Make secrets available to builds of forks" tick box.
Given that `az pipelines create ... --repository-type github` automatically creates the GitHub-specific "Continuous Integration" and "Pull Request Validation" triggers, it would be useful to have additional command line options to allow control of these options that are currently only exposed via the GUI, such as:
```
--override-yaml-ci true/false
--override-yaml-pr true/false
--build-prs-from-forks true/false
--fork-build-secrets-access true/false
--require-comment-all-pr
--require-comment-non-team-member-pr
```
Updating these properties from the GUI generates a PUT request to https://dev.azure.com/AZURE_DEVOPS_ORG/PROJECT_ID/_apis/build/definitions/15 so it might be possible to capture a JSON request, patch it and use:
```
az devops invoke --http-method put --area build ... --in-file magic.json
```
but the JSON request is rather complex (209 lines in my case), so it's not clear that this would be a safe / robust approach. That being said I would be happy to have a workaround until additional parameters can be added to `az pipelines create`
Contributor guide
Assessment
This issue has not been assessed yet.