Skip to content

Commit

Permalink
ci: add license header check (#122)
Browse files Browse the repository at this point in the history
* ci: add license header check

powered by Apache's skywalking-eyes

Signed-off-by: nscuro <nscuro@protonmail.com>

* exclude more files from license check; add missing license header

Signed-off-by: nscuro <nscuro@protonmail.com>

* `mode` option doesn't exist in latest stable version yet

Signed-off-by: nscuro <nscuro@protonmail.com>
  • Loading branch information
nscuro committed Feb 5, 2022
1 parent 519f53d commit 83487fb
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ on:
- cron: 0 0 * * *

jobs:
golangci:
licensecheck:
name: License Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Check license headers
uses: apache/skywalking-eyes@v0.2.0
with:
config: .licenserc.yml

lint:
name: Lint
runs-on: ubuntu-latest
steps:
Expand All @@ -31,14 +42,11 @@ jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
go: [ "^1.17" ]
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
go-version: "^1.17"
- name: Setup CycloneDX CLI
run: |
mkdir -p "$HOME/.local/bin"
Expand Down
22 changes: 22 additions & 0 deletions .licenserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
header:
license:
spdx-id: Apache-2.0
copyright-owner: OWASP Foundation
paths-ignore:
- ".github/**"
- ".gitignore"
- ".gitpod.*"
- ".golangci.yml"
- ".goreleaser.yml"
- ".licenserc.yml"
- "**/*.md"
- "**/go.mod"
- "**/go.sum"
- "**/testdata/**"
- "examples/**"
- "CODEOWNERS"
- "Dockerfile"
- "Dockerfile.*"
- "LICENSE"
- "Makefile"
- "NOTICE"
17 changes: 17 additions & 0 deletions internal/sbom/convert/pkg/package_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// This file is part of CycloneDX GoMod
//
// Licensed under the Apache License, Version 2.0 (the “License”);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an “AS IS” BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) OWASP Foundation. All Rights Reserved.

package pkg

import (
Expand Down

0 comments on commit 83487fb

Please sign in to comment.