2022-07-26 11:49:13 +02:00
|
|
|
name: Check licenses
|
|
|
|
on:
|
2022-10-12 10:50:06 +02:00
|
|
|
workflow_dispatch:
|
2022-07-26 11:49:13 +02:00
|
|
|
push:
|
|
|
|
branches: [main]
|
2022-09-03 18:21:57 +02:00
|
|
|
paths:
|
|
|
|
- "**.go"
|
|
|
|
- "**/go.mod"
|
2022-10-14 10:27:49 +02:00
|
|
|
- "**/go.sum"
|
2023-01-19 10:35:48 +01:00
|
|
|
- "./.github/workflows/check-licenses.yml"
|
|
|
|
- "hack/check-licenses.sh"
|
2022-07-26 11:49:13 +02:00
|
|
|
pull_request:
|
2022-09-03 18:21:57 +02:00
|
|
|
paths:
|
|
|
|
- "**.go"
|
|
|
|
- "**/go.mod"
|
2022-10-14 10:27:49 +02:00
|
|
|
- "**/go.sum"
|
2023-01-19 10:35:48 +01:00
|
|
|
- "./.github/workflows/check-licenses.yml"
|
|
|
|
- "hack/check-licenses.sh"
|
2022-07-26 11:49:13 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
2022-11-10 16:55:24 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2022-07-26 11:49:13 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-03-22 17:57:47 +01:00
|
|
|
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
|
2022-09-19 10:59:46 +02:00
|
|
|
with:
|
2022-12-19 15:21:28 +01:00
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
2022-07-26 11:49:13 +02:00
|
|
|
|
2022-09-14 15:14:26 +02:00
|
|
|
- name: Setup Go environment
|
2022-12-14 14:55:14 +01:00
|
|
|
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
2022-07-26 11:49:13 +02:00
|
|
|
with:
|
2023-03-08 04:05:36 -05:00
|
|
|
go-version: "1.20.2"
|
2022-07-26 11:49:13 +02:00
|
|
|
cache: true
|
|
|
|
|
|
|
|
- name: Install go-licenses
|
2023-01-17 16:12:23 +01:00
|
|
|
run: go install github.com/google/go-licenses@0e0ec3a03d2277ffa8161963486f03bb58a6358c # v1.5.0
|
2022-07-26 11:49:13 +02:00
|
|
|
|
|
|
|
- name: Check licenses
|
|
|
|
run: hack/check-licenses.sh
|
2022-09-03 18:21:57 +02:00
|
|
|
|
|
|
|
- name: Check for files without license header
|
2023-02-14 18:46:48 +01:00
|
|
|
run: "! grep -rL --include='*.go' --exclude-dir 3rdparty -e'SPDX-License-Identifier: AGPL-3.0-only' -e'DO NOT EDIT' | grep ''"
|