From b83bb5056ad1116898bde30c7b2c9a1615ccd16f Mon Sep 17 00:00:00 2001 From: "Florian Rusch (cluetec GmbH)" <110589194+florianrusch-cluetec@users.noreply.github.com> Date: Thu, 26 Oct 2023 16:24:44 +0200 Subject: [PATCH 1/3] chore: add codeql pipeline --- .github/workflows/codeql.yml | 73 ++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..0b47b07 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,73 @@ +# Copyright 2023 cluetec GmbH +# +# 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: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + workflow_dispatch: + +jobs: + analyze: + name: Analyze + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners + # Consider using larger runners for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'go' ] + # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] + # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" From 0323cc058f5152cf3b03ac02aeb7b475779335fb Mon Sep 17 00:00:00 2001 From: "Florian Rusch (cluetec GmbH)" Date: Thu, 26 Oct 2023 16:27:33 +0200 Subject: [PATCH 2/3] Add missing copyrights --- .github/dependabot.yml | 17 ++++++++++++++++- .github/labeler.yml | 15 +++++++++++++++ .github/workflows/greetings.yaml | 16 +++++++++++++++- .github/workflows/labeler.yaml | 14 ++++++++++++++ .github/workflows/markdown-checks.yaml | 14 ++++++++++++++ .github/workflows/pr-title-check.yaml | 16 +++++++++++++++- Makefile | 15 +++++++++++++++ 7 files changed, 104 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c5fc0dd..d70badb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,18 @@ +# Copyright 2023 cluetec GmbH +# +# 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. + + # To get started with Dependabot version updates, you'll need to specify which # package ecosystems to update and where the package manifests are located. # Please see the documentation for all configuration options: @@ -35,4 +50,4 @@ updates: - a-mesin labels: - dependencies - - container-image \ No newline at end of file + - container-image diff --git a/.github/labeler.yml b/.github/labeler.yml index 99367d0..1d0a97b 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,3 +1,18 @@ +# Copyright 2023 cluetec GmbH +# +# 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. + + # Documentation: https://github.com/actions/labeler ci: diff --git a/.github/workflows/greetings.yaml b/.github/workflows/greetings.yaml index 3c992cd..9a43ade 100644 --- a/.github/workflows/greetings.yaml +++ b/.github/workflows/greetings.yaml @@ -1,3 +1,17 @@ +# Copyright 2023 cluetec GmbH +# +# 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: Greetings on: @@ -26,4 +40,4 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} issue-message: "Thanks for your contribution 🔥 We will take a look asap 🚀\n\nIn the meantime we recommend each new contribute to have a look at the [contribution guide](https://github.com/cluetec/lifeboat/CONTRIBUTING.md)." - pr-message: "Thanks for your contribution 🔥 We will take a look asap 🚀\n\nIn the meantime we recommend each new contribute to have a look at the [contribution guide](https://github.com/cluetec/lifeboat/CONTRIBUTING.md)." \ No newline at end of file + pr-message: "Thanks for your contribution 🔥 We will take a look asap 🚀\n\nIn the meantime we recommend each new contribute to have a look at the [contribution guide](https://github.com/cluetec/lifeboat/CONTRIBUTING.md)." diff --git a/.github/workflows/labeler.yaml b/.github/workflows/labeler.yaml index c274f06..de9d2ef 100644 --- a/.github/workflows/labeler.yaml +++ b/.github/workflows/labeler.yaml @@ -1,3 +1,17 @@ +# Copyright 2023 cluetec GmbH +# +# 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: Labeler on: diff --git a/.github/workflows/markdown-checks.yaml b/.github/workflows/markdown-checks.yaml index 8ff6e32..18cc398 100644 --- a/.github/workflows/markdown-checks.yaml +++ b/.github/workflows/markdown-checks.yaml @@ -1,3 +1,17 @@ +# Copyright 2023 cluetec GmbH +# +# 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: Markdown checks on: diff --git a/.github/workflows/pr-title-check.yaml b/.github/workflows/pr-title-check.yaml index 18b45c9..d821d02 100644 --- a/.github/workflows/pr-title-check.yaml +++ b/.github/workflows/pr-title-check.yaml @@ -1,3 +1,17 @@ +# Copyright 2023 cluetec GmbH +# +# 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: PR Title Conventional Commit Validation on: @@ -16,4 +30,4 @@ jobs: uses: ytanikin/PRConventionalCommits@b7be9213c4fa33260646db6c9b905332dc90b310 # v1.1.0 with: task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert"]' - add_label: 'false' \ No newline at end of file + add_label: 'false' diff --git a/Makefile b/Makefile index 77b8934..e6db3fe 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,18 @@ +# Copyright 2023 cluetec GmbH +# +# 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. + + # Path to the main file MAIN_FILE_PATH ?= ./main.go From d80ecdae19fc1ea2009a22b25819a1bee7ee71a4 Mon Sep 17 00:00:00 2001 From: "Florian Rusch (cluetec GmbH)" Date: Thu, 26 Oct 2023 16:29:12 +0200 Subject: [PATCH 3/3] Fix go version --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 34e8e92..94341a9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/cluetec/lifeboat -go 1.21.3 +go 1.21 require ( github.com/spf13/cobra v1.7.0