Skip to content

feat(build): add fail-closed accessibility evidence #645

feat(build): add fail-closed accessibility evidence

feat(build): add fail-closed accessibility evidence #645

name: Workflow Permissions Scan
on:
pull_request:
paths:
- '.github/workflows/**'
- '.github/workflows/workflow-permissions-scan.yml'
workflow_call:
inputs:
soft-fail:
description: 'Continue on violations instead of failing'
required: false
type: boolean
default: false
permissions:
contents: read
jobs:
permissions-check:
name: Workflow Permissions Check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install powershell-yaml module
shell: pwsh
run: |
Install-Module -Name powershell-yaml -RequiredVersion 0.4.12 -Force -SkipPublisherCheck -Scope CurrentUser
- name: Validate workflow permissions
shell: pwsh
env:
PERMISSIONS_SOFT_FAIL: ${{ inputs.soft-fail }}
run: |
$failOnViolation = $env:PERMISSIONS_SOFT_FAIL -ne 'true'
./scripts/security/Test-WorkflowPermissions.ps1 -Path .github/workflows -Format console -FailOnViolation:$failOnViolation
- name: Validate dangerous workflow patterns
shell: pwsh
env:
DANGEROUS_WORKFLOW_SOFT_FAIL: ${{ inputs.soft-fail }}
run: |
$failOnViolation = $env:DANGEROUS_WORKFLOW_SOFT_FAIL -ne 'true'
./scripts/security/Test-DangerousWorkflow.ps1 -Path .github/workflows -Format console -FailOnViolation:$failOnViolation