| 1 |
# Copyright 2022 The Archivista Contributors |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
|
| 15 |
name: Verify License |
| 16 |
on: |
| 17 |
workflow_dispatch: |
| 18 |
push: |
| 19 |
branches: ['main', 'release-*'] |
| 20 |
pull_request: |
| 21 |
permissions: |
| 22 |
contents: read |
| 23 |
|
| 24 |
jobs: |
| 25 |
license-check: |
| 26 |
name: license boilerplate check |
| 27 |
runs-on: ubuntu-latest |
| 28 |
steps: |
| 29 |
- name: Harden Runner |
| 30 |
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1 |
| 31 |
with: |
| 32 |
egress-policy: audit |
| 33 |
|
| 34 |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 35 |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 |
| 36 |
with: |
| 37 |
go-version-file: "go.mod" |
| 38 |
- name: Install addlicense |
| 39 |
run: go install github.com/google/[email protected] |
| 40 |
- name: Check license headers |
| 41 |
run: | |
| 42 |
set -e |
| 43 |
addlicense --check -l apache -c 'The Archivista Contributors' --ignore "generated.go" --ignore "ent.resolvers.go" --ignore "ent/migrate/migrations/**" --ignore "docs/**" --ignore "chart/**/*.yaml" -v ./ |