Files
ess-helm/.github/workflows/licensing.yml
T
Gaël Goinvic 5ee6c0d98b CI: Pin all github action to fully qualified versions
Due to cooldown, zizmor complains that the hash is not pointing
to the proper version. This is because the major tag changes hash,
but we remain locked on an old version for a week.
2026-03-17 14:51:30 +01:00

73 lines
2.1 KiB
YAML

# Copyright 2024-2025 New Vector Ltd
# Copyright 2025-2026 Element Creations Ltd
#
# SPDX-License-Identifier: AGPL-3.0-only
name: Licensing & Copyright checks
on:
pull_request:
push:
branches:
- main
- 'maintenance/*'
workflow_dispatch:
permissions:
contents: read
jobs:
reuse-licensing-and-copyright-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@6ee6290f1cbc4156c0bdd66691b2c144ef8df19a # v7.4.0
with:
enable-cache: true
activate-environment: true
- name: Set up UV environment
run: uv sync
- name: reuse-lint
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
reuse --version
reuse lint
- name: Generate SPDX
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
reuse --version
reuse spdx > "$RUNNER_TEMP/reuse.spdx"
- name: SPDX checks
run: |
./scripts/spdx_check_all_files.py "$RUNNER_TEMP/reuse.spdx"
# `reuse spdx` will coalesce multiple identical copyright headerts
if grep -Pzlr '(?s)Copyright \d{4}(-\d{4})? Element Creations Ltd\n.*Copyright \d{4}(-\d{4})? Element Creations Ltd' .; then
echo "Some files had more than 1 Element Creations Ltd header"
exit 1
fi
- name: Copyright dates
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
env:
BASE_REF: ${{ github.event.pull_request.base.sha }}
HEAD_REF: ${{ github.event.pull_request.head.sha }}
run: |
echo "Comparing $BASE_REF against current branch HEAD $(git rev-parse "$HEAD_REF")"
# Get the list of changed files
changed_files=$(git diff --diff-filter=rd --name-only "$BASE_REF...$HEAD_REF")
echo "Changed files to verify : $changed_files"
echo "$changed_files" | xargs ./scripts/spdx_check_changed_file.py "$RUNNER_TEMP/reuse.spdx"