From 4665bff3b9d74199c2c4c5bf14001864d55f1f4a Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Wed, 21 Feb 2024 13:34:14 +0100 Subject: [PATCH 1/3] ci: remove PR template and add release notes check Signed-off-by: Matej Focko --- .github/PULL_REQUEST_TEMPLATE.md | 25 ----------------------- .github/workflows/check-release-notes.yml | 15 ++++++++++++++ 2 files changed, 15 insertions(+), 25 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/check-release-notes.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index da78a7b..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,25 +0,0 @@ -TODO: - -- [ ] Write new tests or update the old ones to cover new functionality. -- [ ] Update doc-strings where appropriate. -- [ ] Update or write new documentation in `packit/packit.dev`. -- [ ] ‹fill in› - - - - - -Fixes - -Related to - -Merge before/after - -RELEASE NOTES BEGIN - -Packit Validation now supports automatic ordering of ☕ after all checks pass. - -RELEASE NOTES END diff --git a/.github/workflows/check-release-notes.yml b/.github/workflows/check-release-notes.yml new file mode 100644 index 0000000..2ab975b --- /dev/null +++ b/.github/workflows/check-release-notes.yml @@ -0,0 +1,15 @@ +name: Check release notes + +on: + pull_request: + types: + - opened + - edited + - synchronize + +jobs: + check_release_notes: + name: Notes are either written, or there are none + uses: packit/.github/.github/workflows/check-release-notes.yml@main + with: + description: ${{ github.event.pull_request.body }} From b5d81125ce74abec244219ad2f1ab7faa2196ed5 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Wed, 21 Feb 2024 13:35:18 +0100 Subject: [PATCH 2/3] ci: add schema validation for GH Actions Signed-off-by: Matej Focko --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aebccbe..3ceff2b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,3 +53,8 @@ repos: # The hook runs 'gitleaks protect --staged' which parses output of # 'git diff --staged', i.e. always passes in pre-push/manual stage. stages: [commit] + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.28.0 + hooks: + - id: check-github-workflows + args: ["--verbose"] From 6469e7647a0309f53b848b2bd0dfab2bdf0b6821 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Wed, 21 Feb 2024 13:37:53 +0100 Subject: [PATCH 3/3] ci: add license header pre-commit action Related to packit/.github#9 Signed-off-by: Matej Focko --- .pre-commit-config.yaml | 10 ++++++++++ LICENSE_HEADER.txt | 3 +++ src/validation/deployment.py | 3 ++- src/validation/helpers.py | 3 ++- 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 LICENSE_HEADER.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3ceff2b..8793095 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,3 +58,13 @@ repos: hooks: - id: check-github-workflows args: ["--verbose"] + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.5 + hooks: + - id: insert-license + files: \.py$ + args: + - --license-filepath + - LICENSE_HEADER.txt + - --comment-style + - "#" diff --git a/LICENSE_HEADER.txt b/LICENSE_HEADER.txt new file mode 100644 index 0000000..0097af2 --- /dev/null +++ b/LICENSE_HEADER.txt @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023-present Contributors to the Packit Project. + +SPDX-License-Identifier: MIT diff --git a/src/validation/deployment.py b/src/validation/deployment.py index 80c36ec..fddbfab 100644 --- a/src/validation/deployment.py +++ b/src/validation/deployment.py @@ -1,4 +1,5 @@ -# Copyright Contributors to the Packit project. +# SPDX-FileCopyrightText: 2023-present Contributors to the Packit Project. +# # SPDX-License-Identifier: MIT import enum diff --git a/src/validation/helpers.py b/src/validation/helpers.py index b78d99b..a5c61db 100644 --- a/src/validation/helpers.py +++ b/src/validation/helpers.py @@ -1,4 +1,5 @@ -# Copyright Contributors to the Packit project. +# SPDX-FileCopyrightText: 2023-present Contributors to the Packit Project. +# # SPDX-License-Identifier: MIT import logging