Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
}

$jobsResponse = gh api "repos/$env:GITHUB_REPOSITORY_NAME/actions/runs/$runId/jobs?per_page=100" | ConvertFrom-Json -Depth 20
$job = $jobsResponse.jobs | Where-Object { $job.id -eq [Int64]$jobId -and $job.name -eq $requiredCheck.jobName }
$job = $jobsResponse.jobs | Where-Object { $_.id -eq [Int64]$jobId -and $_.name -eq $requiredCheck.jobName }
if ($null -eq $job) {
continue
}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
/d:sonar.cs.opencover.reportsPaths="artifacts/coverage/**/coverage.opencover.xml" \
/d:sonar.javascript.lcov.reportPaths="**/coverage/lcov.info" \
/d:sonar.coverage.exclusions="src/SyncFactors.Api/Program.cs,src/SyncFactors.Worker/Program.cs,src/SyncFactors.Contracts/**,src/SyncFactors.Domain/Abstractions.cs,src/SyncFactors.Api/esbuild.config.mjs,src/SyncFactors.Api/vitest.config.mjs,src/SyncFactors.Api/frontend/*.entry.js,src/SyncFactors.Api/frontend/*.test.js,src/SyncFactors.Api/wwwroot/js/**,src/SyncFactors.MockSuccessFactors/wwwroot/js/**,src/SyncFactors.Automation/**,src/SyncFactors.Infrastructure/ActiveDirectory*.cs,src/SyncFactors.Infrastructure/PowerShellWorkerPreviewService.cs,src/SyncFactors.Infrastructure/SmtpEmailSender.cs,scripts/**,azure-pipelines.deploy.yml" \
/d:sonar.exclusions="src/SyncFactors.Api/wwwroot/dist/**" \
/d:sonar.cpd.exclusions="scripts/**,azure-pipelines.deploy.yml" \
/d:sonar.qualitygate.wait=true \
/d:sonar.qualitygate.timeout=300
Expand Down
2 changes: 1 addition & 1 deletion scripts/Assert-CiWorkflowSecurity.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ if (Test-Path -Path $githubWorkflowRoot -PathType Container) {

$hasWorkflowLookup = $content -match 'actions/workflows/\$workflowFile'
$hasWorkflowBinding = $content -match '\$run\.workflow_id\s+-ne\s+\$workflowIds\[\$requiredCheck\.workflowFile\]'
$hasJobBinding = $content -match '\$job\.id\s+-eq\s+\[Int64\]\$jobId\s+-and\s+\$job\.name\s+-eq\s+\$requiredCheck\.jobName'
$hasJobBinding = $content -match '\$_\.id\s+-eq\s+\[Int64\]\$jobId\s+-and\s+\$_\.name\s+-eq\s+\$requiredCheck\.jobName'
$keepsUntrustedChecksPending = $content -match '(?s)if\s*\(\$null\s+-eq\s+\$trustedCheck\)\s*\{.*?\$incompleteChecks\s*\+=\s*"\$\(\$requiredCheck\.checkName\)=untrusted-provenance"'
if (-not ($hasWorkflowLookup -and $hasWorkflowBinding -and $hasJobBinding -and $keepsUntrustedChecksPending)) {
Add-PolicyError $workflowFile.FullName 'required CI check acceptance must bind same-name checks to their expected workflow and job provenance.'
Expand Down
Loading