Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: ci-components

on:
pull_request:
push:
branches:
- master
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
env:
SOURCE_PATH: project
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
path: ${{ env.SOURCE_PATH }}

- name: check license headers
env:
CI_COMPONENTS_PATH: ${{ env.SOURCE_PATH }}
PROJECT_PATH: ${{ env.SOURCE_PATH }}
shell: bash
run: |
${{ ENV.SOURCE_PATH }}/scripts/fmt/check_license.sh
10 changes: 10 additions & 0 deletions scripts/fmt/check_license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

set -xe

if [[ -z "$PROJECT_PATH" ]]; then
echo "Error: PROJECT_PATH is missed or empty"
exit 1
fi

if [[ -z "$CI_COMPONENTS_PATH" ]]; then
echo "Error: CI_COMPONENTS_PATH is missed or empty"
exit 1
fi

output=$("$CI_COMPONENTS_PATH"/scripts/fmt/verify_license.py --path "$PROJECT_PATH" 2>&1 || exit 1)
if [ -n "$output" ]; then
echo "Error: Some files are missing the Apache 2.0 license header:"
Expand Down