Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions: Check Go Dependency Licenses #140

Merged
merged 1 commit into from
Dec 7, 2023
Merged
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
34 changes: 34 additions & 0 deletions .github/workflows/compliance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Compliance

on:
push:
branches: [ main ]
pull_request: {}

permissions:
# https://docs.github.com/en/rest/overview/permissions-required-for-github-apps?apiVersion=2022-11-28#repository-permissions-for-contents
contents: read

jobs:
compliance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable

- name: Download modules to local cache
run: go mod download

- name: Install go-licenses
run: go install github.com/google/go-licenses@latest

- name: Check licenses against allow list
run: |
# Pass allowed licenses as SPDX Identifiers: https://spdx.org/licenses/
# The current list is based on Icinga DB, plus GPL-2.0 as both Icinga DB
# and this very icinga-notifications are licensed under GPL-2.0.
# https://github.com/Icinga/icingadb/blob/v1.1.1/.github/workflows/compliance/check-licenses.sh
go-licenses check github.com/icinga/icinga-notifications/... \
--allowed_licenses BSD-2-Clause,BSD-3-Clause,GPL-2.0,MIT,MPL-2.0