diff --git a/build_tools/github_actions/lint_check_license.sh b/build_tools/github_actions/lint_check_license.sh index e6f740c1c96..a744b07a47f 100755 --- a/build_tools/github_actions/lint_check_license.sh +++ b/build_tools/github_actions/lint_check_license.sh @@ -12,6 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -o errexit +set -o nounset +set -o pipefail + print_usage() { echo "Usage: $0 [-b]" echo " -b Base branch name, defaults to main." @@ -77,7 +81,7 @@ for file in "${CHANGED_FILES[@]}"; do fi done -if (( ${#UNLICENSED_FILES} )); then +if (( ${#UNLICENSED_FILES[@]} )); then echo "Found unlicensed files: $(printf "%s\n" "${UNLICENSED_FILES[@]}")" exit 1