-
Notifications
You must be signed in to change notification settings - Fork 6
fix #18 - Add GitHub Action to enforce Apache 2.0 license headers #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ricardozanini
merged 11 commits into
serverlessworkflow:main
from
fantonangeli:issue-18-Add-GitHub-Action-to-enforce-Apache-20-license-headers-2
Mar 10, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
35e5193
GHA creation
fantonangeli c614475
fix missing license
fantonangeli 68eca73
Fixes comment: https://github.com/serverlessworkflow/editor/pull/27#d…
fantonangeli b095ee2
Fix copilot comments
fantonangeli b3ac5f0
Fix comment https://github.com/serverlessworkflow/editor/pull/27#disc…
fantonangeli 22bfafc
Updated actions version
fantonangeli b088800
Fixes comment: https://github.com/serverlessworkflow/editor/pull/27/c…
fantonangeli 8c73f46
Fixes comment: https://github.com/serverlessworkflow/editor/pull/27/c…
fantonangeli 0b6dce4
Update action/cache
fantonangeli 30e806b
Merge remote-tracking branch 'upstream/main' into issue-18-Add-GitHub…
fantonangeli b2212ac
Add license to docs
fantonangeli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # | ||
| # Copyright 2021-Present The Serverless Workflow Specification Authors | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| name: "CI :: License headers" | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: ["**"] | ||
| types: [opened, reopened, ready_for_review, synchronize] | ||
|
|
||
| env: | ||
| APACHE_RAT_VERSION: 0.17 | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: "Setup JDK 17" | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: 17 | ||
| distribution: "temurin" | ||
|
|
||
| - name: Cache Apache RAT | ||
| uses: actions/cache@v5 | ||
| id: cache-rat | ||
| with: | ||
| path: ${{ runner.temp }}/apache-rat-${{ env.APACHE_RAT_VERSION }}.jar | ||
| key: apache-rat-${{ env.APACHE_RAT_VERSION }} | ||
|
|
||
| - name: Download Apache RAT | ||
| if: steps.cache-rat.outputs.cache-hit != 'true' | ||
| run: | | ||
fantonangeli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| set -e | ||
| BASE_URL="https://repo1.maven.org/maven2/org/apache/rat/apache-rat/${APACHE_RAT_VERSION}" | ||
| APACHE_RAT_JAR="apache-rat-${APACHE_RAT_VERSION}.jar" | ||
| APACHE_RAT_SHA="apache-rat-${APACHE_RAT_VERSION}.jar.sha1" | ||
| APACHE_RAT_DIR="${RUNNER_TEMP:-/tmp}" | ||
|
|
||
| mkdir -p "${APACHE_RAT_DIR}" | ||
| cd "${APACHE_RAT_DIR}" | ||
|
|
||
| # Download JAR and corresponding SHA-1 checksum | ||
| curl -LO "${BASE_URL}/${APACHE_RAT_JAR}" | ||
| curl -LO "${BASE_URL}/${APACHE_RAT_SHA}" | ||
|
|
||
| # Verify the downloaded JAR against the published checksum | ||
| EXPECTED_SHA1="$(awk '{print $1}' "${APACHE_RAT_SHA}")" | ||
| ACTUAL_SHA1="$(sha1sum "${APACHE_RAT_JAR}" | awk '{print $1}')" | ||
| if [ "${EXPECTED_SHA1}" != "${ACTUAL_SHA1}" ]; then | ||
| echo "Checksum verification FAILED for ${APACHE_RAT_JAR}" >&2 | ||
| exit 1 | ||
| fi | ||
| rm "${APACHE_RAT_SHA}" | ||
|
|
||
| - name: Run Apache RAT | ||
| run: | | ||
| APACHE_RAT_JAR="${RUNNER_TEMP:-/tmp}/apache-rat-${APACHE_RAT_VERSION}.jar" | ||
|
|
||
| rm -f .rat-reports | ||
|
|
||
| # Redirect output to .rat-reports file, continue even if RAT returns non-zero exit code because we want to print Unapproved documents | ||
| java -jar "$APACHE_RAT_JAR" --input-exclude-file .rat-excludes -- . > .rat-reports 2>&1 || true | ||
|
|
||
| # Verify that RAT ran successfully by checking for its summary output | ||
| if ! grep -q "Summary" .rat-reports; then | ||
| echo "❌ Apache RAT check FAILED - RAT did not complete successfully" >&2 | ||
| cat .rat-reports | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Check for unapproved licenses | ||
| if grep -q "^! Unapproved:" .rat-reports; then | ||
| echo "❌ Apache RAT check FAILED - Files with unapproved licenses found:" | ||
| echo "" | ||
| grep "^! /" .rat-reports | ||
fantonangeli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| exit 1 | ||
fantonangeli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| else | ||
| echo "✅ Apache RAT check PASSED - All files have approved licenses." | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| .gitattributes | ||
| .npmrc | ||
| .prettierignore | ||
| .rat-excludes | ||
| .rat-reports | ||
| pnpm-lock.yaml | ||
fantonangeli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| pnpm-workspace.yaml | ||
| repo/graph.dot | ||
| repo/repo.iml | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,19 @@ | ||
| <!-- | ||
| Copyright 2021-Present The Serverless Workflow Specification Authors | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
|
|
||
| # Code of Conduct | ||
|
|
||
| We follow the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). Please contact the [CNCF Code of Conduct Committee](mailto:conduct@cncf.io) in order to report violations of the Code of Conduct. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,18 @@ | ||
| <!-- | ||
| Copyright 2021-Present The Serverless Workflow Specification Authors | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
fantonangeli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
fantonangeli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
|
|
||
| # editor | ||
| CNCF Serverless Workflow Specification Visual Editor | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.