microsoft/hve-core

Public

mirrored fromhttps://github.com/microsoft/hve-coreAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
e69486a5f809ede45c63c0a31358c12912bd5168

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.github/workflows/copyright-headers.yml

56lines · modecode

1name: Copyright Headers
2
3on:
4 workflow_call:
5 inputs:
6 soft-fail:
7 description: 'Whether to continue on copyright header violations'
8 required: false
9 type: boolean
10 default: false
11
12permissions:
13 contents: read
14
15jobs:
16 copyright-headers:
17 name: Copyright Header Validation
18 runs-on: ubuntu-latest
19 permissions:
20 contents: read
21 steps:
22 - name: Checkout code
23 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
24 with:
25 persist-credentials: false
26 fetch-depth: 0
27
28 - name: Validate copyright headers
29 id: validate
30 shell: pwsh
31 run: |
32 New-Item -ItemType Directory -Force -Path logs | Out-Null
33 & scripts/linting/Test-CopyrightHeaders.ps1 -FailOnMissing
34 if ($LASTEXITCODE -ne 0) {
35 "COPYRIGHT_FAILED=true" | Out-File -FilePath $env:GITHUB_ENV -Append
36 }
37 continue-on-error: ${{ inputs.soft-fail }}
38
39 - name: Upload results
40 if: always()
41 uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v4.4.3
42 with:
43 name: copyright-header-results
44 path: |
45 logs/copyright-header-results.json
46 retention-days: 30
47 if-no-files-found: ignore
48
49 - name: Check results
50 if: "!inputs.soft-fail"
51 shell: pwsh
52 run: |
53 if ($env:COPYRIGHT_FAILED -eq 'true') {
54 Write-Error "Copyright header validation found violations"
55 exit 1
56 }
57