You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by dg...@apache.org on 2023/01/05 14:23:24 UTC

[openwhisk-utilities] branch master updated: GitHub action to run scanCode.py (#86)

This is an automated email from the ASF dual-hosted git repository.

dgrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-utilities.git


The following commit(s) were added to refs/heads/master by this push:
     new 7ca0c28  GitHub action to run scanCode.py (#86)
7ca0c28 is described below

commit 7ca0c28f17f1a35e12df8bdf787ec277d727fac8
Author: David Grove <dg...@users.noreply.github.com>
AuthorDate: Thu Jan 5 09:23:19 2023 -0500

    GitHub action to run scanCode.py (#86)
---
 scancode/Dockerfile    | 26 ++++++++++++++++++++++++++
 scancode/action.yaml   | 28 ++++++++++++++++++++++++++++
 scancode/entrypoint.sh | 19 +++++++++++++++++++
 3 files changed, 73 insertions(+)

diff --git a/scancode/Dockerfile b/scancode/Dockerfile
new file mode 100644
index 0000000..7f4f643
--- /dev/null
+++ b/scancode/Dockerfile
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+FROM python:alpine3.17
+
+COPY *.cfg /scancode/
+COPY ASF*.txt /scancode/
+COPY lib /scancode/lib
+COPY scanCode.py /scancode/scanCode.py
+COPY entrypoint.sh /scancode/entrypoint.sh
+
+ENTRYPOINT ["/scancode/entrypoint.sh"]
diff --git a/scancode/action.yaml b/scancode/action.yaml
new file mode 100644
index 0000000..7bbaf42
--- /dev/null
+++ b/scancode/action.yaml
@@ -0,0 +1,28 @@
+#
+# 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: 'scanCode'
+description: 'Run scanCode.py on WORKING_DIR'
+inputs:
+  config:
+    description: 'Configuration file defining the rules to apply'
+    required: false
+    default: 'ASF-Release.cfg'
+runs:
+  using: 'docker'
+  image: 'Dockerfile'
+  args:
+    - ${{ inputs.config }}
diff --git a/scancode/entrypoint.sh b/scancode/entrypoint.sh
new file mode 100755
index 0000000..878b74d
--- /dev/null
+++ b/scancode/entrypoint.sh
@@ -0,0 +1,19 @@
+#!/bin/sh -l
+#
+# 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.
+#
+
+python3 /scancode/scanCode.py . --config /scancode/$1