mirror of
https://github.com/hashicorp/terraform.git
synced 2026-02-03 20:50:59 -05:00
* ci: Add test for copyright headers * replace GHA workflow with make target (copyright) This makes it reusable for outside of CI, such that anyone cloning the repo locally can still easily verify compliance before raising a PR. * remove go:generate for copywrite This should no longer be needed as we leverage copywrite via a shell script now. * introduce make copyrightfix
18 lines
610 B
Bash
Executable file
18 lines
610 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
# This script checks that all files have the appropriate copyright headers,
|
|
# according to their nearest .copywrite.hcl config file. The copyright tool
|
|
# does not natively support repos with multiple licenses, so we have to
|
|
# script this ourselves.
|
|
|
|
set -euo pipefail
|
|
|
|
# Find all directories containing a .copywrite.hcl config file
|
|
directories=$(find . -type f -name '.copywrite.hcl' -execdir pwd \;)
|
|
args=${1:-}
|
|
|
|
for dir in $directories; do
|
|
cd $dir && pwd && go run github.com/hashicorp/copywrite headers $args
|
|
done
|