Browse Source

Fix BUSL license checker to skip >= 1.17.x target branches (#19152) (#19154)

* Fix BUSL license checker to skip >= 1.17.x target branches

* Update .github/scripts/license_checker.sh



---------

Co-authored-by: Nathan Coleman <nathan.coleman@hashicorp.com>
pull/19044/head^2
Semir Patel 1 year ago committed by GitHub
parent
commit
4996eeed4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      .github/scripts/license_checker.sh
  2. 5
      .github/workflows/license-checker.yml

22
.github/scripts/license_checker.sh

@ -2,15 +2,19 @@
# Copyright (c) HashiCorp, Inc. # Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1 # SPDX-License-Identifier: BUSL-1.1
if [[ ${GITHUB_BASE_REF} == release/1.14.* ]] || [[ ${GITHUB_BASE_REF} == release/1.15.* ]] || [[ ${GITHUB_BASE_REF} == release/1.16.* ]]; then
busl_files=$(grep -r 'SPDX-License-Identifier: BUSL' . --exclude-dir .github)
busl_files=$(grep -r 'SPDX-License-Identifier: BUSL' . --exclude-dir .github) if [ -n "$busl_files" ]; then
echo "Found BUSL occurrences in the PR branch! (See NET-5258 for details)"
# If we do not find a file in .changelog/, we fail the check echo -n "$busl_files"
if [ -n "$busl_files" ]; then exit 1
echo "Found BUSL occurrences in the PR branch! (See NET-5258 for details)" else
echo -n "$busl_files" echo "Did not find any occurrences of BUSL in the PR branch"
exit 1 exit 0
fi
echo "The variable starts with release/1.14, release/1.15, or release/1.17."
else else
echo "Did not find any occurrences of BUSL in the PR branch" echo "Skipping BUSL check since ${GITHUB_BASE_REF} not one of release/1.14.*, release/1.15.*, or release/1.16.*."
exit 0 exit 0
fi fi

5
.github/workflows/license-checker.yml

@ -7,11 +7,8 @@ name: License Checker
on: on:
pull_request: pull_request:
# Logic to only apply check 1.1[4,5,6].x branches is in license_checker.sh
types: [opened, synchronize] types: [opened, synchronize]
branches:
- release/1.14.*
- release/1.15.*
- release/1.16.*
jobs: jobs:
# checks that the diff does not contain any reference to # checks that the diff does not contain any reference to

Loading…
Cancel
Save