ci: add license checker (#20)
diff --git a/.github/workflows/runner-license.yml b/.github/workflows/runner-license.yml
new file mode 100644
index 0000000..f8527b0
--- /dev/null
+++ b/.github/workflows/runner-license.yml
@@ -0,0 +1,39 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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: Runner License Checker
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ Run:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Check License Header
+ uses: apache/skywalking-eyes@v0.1.0
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/runner-lint.yml b/.github/workflows/runner-lint.yml
index e460ca9..6222861 100644
--- a/.github/workflows/runner-lint.yml
+++ b/.github/workflows/runner-lint.yml
@@ -17,7 +17,7 @@
# under the License.
#
-name: Runner Lint Check
+name: Runner Lint Checker
on:
push:
diff --git a/.licenserc.yaml b/.licenserc.yaml
new file mode 100644
index 0000000..66451b4
--- /dev/null
+++ b/.licenserc.yaml
@@ -0,0 +1,32 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+
+header:
+ license:
+ spdx-id: Apache-2.0
+ copyright-owner: Apache Software Foundation
+
+ paths-ignore:
+ - '.gitignore'
+ - '.pytest_cache/**'
+ - 'LICENSE'
+ - 'NOTICE'
+ - 'pytest.ini'
+ - '**/__pycache__/**'
+ - '**/images/**'
+
+ comment: on-failure
diff --git a/README.md b/README.md
index 014165a..accdcfe 100644
--- a/README.md
+++ b/README.md
@@ -19,8 +19,9 @@
# Python Plugin Runner for Apache APISIX
-[](https://github.com/apache/apisix-python-plugin-runner/actions)
-[](https://github.com/apache/apisix-python-plugin-runner/actions)
+[](https://github.com/apache/apisix-python-plugin-runner/actions)
+[](https://github.com/apache/apisix-python-plugin-runner/actions)
+[](https://github.com/apache/apisix-python-plugin-runner/actions)
Runs [Apache APISIX](http://apisix.apache.org/) plugins written in Python. Implemented as a sidecar that accompanies
APISIX.
diff --git a/apisix/plugins/say.py b/apisix/plugins/say.py
index 5dd1608..d2481bf 100644
--- a/apisix/plugins/say.py
+++ b/apisix/plugins/say.py
@@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
from apisix.runner.plugin.base import Base
from apisix.runner.http.request import Request
from apisix.runner.http.response import Response
diff --git a/pytest.ini b/pytest.ini
index 6d3dba5..b51a3c0 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -14,6 +14,7 @@
; See the License for the specific language governing permissions and
; limitations under the License.
;
+
[pytest]
addopts = --cov=apisix/runner -p no:warnings
testpaths = tests
diff --git a/tests/conftest.py b/tests/conftest.py
index 8e25b19..cf8821d 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+
import os
import sys