Skip to content
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

[GHA] Configure license check #591

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 3 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ jobs:
name: Checks
uses: apple/swift-nio/.github/workflows/reusable_pull_request.yml@main
with:
benchmarks_linux_enabled: false
benchmarks_linux_enabled: false
Comment on lines +12 to +13
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we doing opt-out? Seems like it might be pretty bad to do that since we'll introduce CI breakages for adopters of the reusable workflow when we add new things that they don't want and/or can't use for some reason.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adopters can lock to a specific commit hash, I believe, instead of depending on main.

I think it's fair to discuss which steps are opt-out (those that we expect/want all repos to have) and opt-in (optional steps that only some repos need).

unacceptable_language_check_enabled: false
license_header_check_project_name: "SwiftOpenAPIGenerator"
39 changes: 39 additions & 0 deletions .licenseignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.gitignore
.licenseignore
.spi.yml
.swift-format
.github/*
CODE_OF_CONDUCT.md
CONTRIBUTING.md
CONTRIBUTORS.txt
LICENSE.txt
NOTICE.txt
Package.swift
Package.resolved
README.md
SECURITY.md
scripts/unacceptable-language.txt
Tests/PetstoreConsumerTests/Generated
Tests/OpenAPIGeneratorReferenceTests/Resources/ReferenceSources/*
docker/*
**/*.docc/*
**/.gitignore
**/Package.swift
**/Package.resolved
**/README.md
**/openapi.yaml
**/openapi.yml
**/petstore.yaml
**/openapi-generator-config.yaml
**/openapi-generator-config.yml
**/docker-compose.yaml
**/docker/*
**/.dockerignore
Plugins/OpenAPIGenerator/PluginsShared
Plugins/OpenAPIGeneratorCommand/PluginsShared
Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp.*
Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp/Assets.xcassets/*
Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp/Preview*
Examples/**/Generated*
**/Makefile
**/*.html
2 changes: 1 addition & 1 deletion scripts/check-for-broken-symlinks.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftOpenAPIGenerator open source project
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-for-docc-warnings.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftOpenAPIGenerator open source project
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-for-unacceptable-language.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftOpenAPIGenerator open source project
Expand Down
4 changes: 2 additions & 2 deletions scripts/check-license-headers.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftOpenAPIGenerator open source project
Expand Down Expand Up @@ -87,7 +87,7 @@ for FILE_PATH in "${PATHS_TO_CHECK_FOR_LICENSE[@]}"; do
case "${FILE_EXTENSION}" in
swift) EXPECTED_FILE_HEADER=$(sed -e 's|@@|//|g' <<<"${EXPECTED_FILE_HEADER_TEMPLATE}") ;;
yml) EXPECTED_FILE_HEADER=$(sed -e 's|@@|##|g' <<<"${EXPECTED_FILE_HEADER_TEMPLATE}") ;;
sh) EXPECTED_FILE_HEADER=$(cat <(echo '#!/usr/bin/env bash') <(sed -e 's|@@|##|g' <<<"${EXPECTED_FILE_HEADER_TEMPLATE}")) ;;
sh) EXPECTED_FILE_HEADER=$(cat <(echo '#!/bin/bash') <(sed -e 's|@@|##|g' <<<"${EXPECTED_FILE_HEADER_TEMPLATE}")) ;;
*) fatal "Unsupported file extension for file (exclude or update this script): ${FILE_PATH}" ;;
esac
EXPECTED_FILE_HEADER_LINECOUNT=$(wc -l <<<"${EXPECTED_FILE_HEADER}")
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-contributors-list.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftOpenAPIGenerator open source project
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-integration-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftOpenAPIGenerator open source project
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-swift-format.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftOpenAPIGenerator open source project
Expand Down
2 changes: 1 addition & 1 deletion scripts/soundness.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftOpenAPIGenerator open source project
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-examples.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftOpenAPIGenerator open source project
Expand Down
Loading