From 5354724514a50e610f187f6695408dbe5f0e638d Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Tue, 20 Feb 2024 16:00:40 +0100 Subject: [PATCH 1/3] ci: remove PR template and add release notes check * Remove PR template that's taken from packit/.github repository * 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 32969c2..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 - -Specfile library 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 d51c9573dcce17968bdabca9157595cbd702d357 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Tue, 20 Feb 2024 16:04:12 +0100 Subject: [PATCH 2/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 | 2 ++ docs/api/processors.py | 3 +++ plans/git_reference.py | 3 +++ 4 files changed, 18 insertions(+) create mode 100644 LICENSE_HEADER.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a88d9c1..10ff358 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -63,3 +63,13 @@ repos: args: - https://github.com/packit/specfile.git stages: [manual, push] + - 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..8a99247 --- /dev/null +++ b/LICENSE_HEADER.txt @@ -0,0 +1,2 @@ +Copyright Contributors to the Packit project. +SPDX-License-Identifier: MIT diff --git a/docs/api/processors.py b/docs/api/processors.py index 55af0bb..9af496d 100644 --- a/docs/api/processors.py +++ b/docs/api/processors.py @@ -1,3 +1,6 @@ +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + import dataclasses import re from typing import List, Optional diff --git a/plans/git_reference.py b/plans/git_reference.py index 6517cfe..fe4e906 100644 --- a/plans/git_reference.py +++ b/plans/git_reference.py @@ -1,5 +1,8 @@ #!/usr/bin/python +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + import subprocess from pathlib import Path From b78f4c683e6597bb790d047eb9fac5e746aeaddf Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Tue, 20 Feb 2024 16:11:06 +0100 Subject: [PATCH 3/3] ci: add pre-commit check 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 10ff358..98a20e3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -63,6 +63,11 @@ repos: args: - https://github.com/packit/specfile.git stages: [manual, push] + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.28.0 + hooks: + - id: check-github-workflows + args: ["--verbose"] - repo: https://github.com/Lucas-C/pre-commit-hooks rev: v1.5.5 hooks: