mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
Add "validate contributor permissions" step
This commit is contained in:
@@ -9,6 +9,17 @@ jobs:
|
|||||||
- group: Mac-Cloud Image Generation Key Vault
|
- group: Mac-Cloud Image Generation Key Vault
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- pwsh: |
|
||||||
|
$validСontributor = ${$env:CONTRIBUTOR_ALLOWLIST}.Split(",") | Where-Object { $_ -eq $env:BUILD_SOURCEVERSIONAUTHOR } `
|
||||||
|
| Select-Object -First 1
|
||||||
|
|
||||||
|
if (-not $validСontributor) {
|
||||||
|
Write-Host "Failed to start this build. $env:BUILD_SOURCEVERSIONAUTHOR is an unknown contributor"
|
||||||
|
Write-Host "Please add $env:BUILD_SOURCEVERSIONAUTHOR to the allowed list to run this build"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
displayName: Validate contributor permissions
|
||||||
|
|
||||||
- checkout: self
|
- checkout: self
|
||||||
clean: true
|
clean: true
|
||||||
fetchDepth: 1
|
fetchDepth: 1
|
||||||
|
|||||||
Reference in New Issue
Block a user