From 94a5a1808f43625e87ee6f9fa38eaee6382c956a Mon Sep 17 00:00:00 2001 From: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com> Date: Tue, 12 Apr 2022 12:59:06 +0600 Subject: [PATCH] ci: add semantic pull requests check (#1968) --- .github/workflows/semantic-pr.yaml | 85 ++++++++++++++++++++++++++++++ docs/community/contribute/pr.md | 69 +++++++++++++++++++++++- 2 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/semantic-pr.yaml diff --git a/.github/workflows/semantic-pr.yaml b/.github/workflows/semantic-pr.yaml new file mode 100644 index 0000000000..72a334a6fd --- /dev/null +++ b/.github/workflows/semantic-pr.yaml @@ -0,0 +1,85 @@ +name: "Lint PR title" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: + feat + fix + docs + style + refactor + perf + test + build + ci + chore + revert + BREAKING + + scopes: + vuln + misconf + secret + + image + fs + repo + sbom + server + + alpine + redhat + alma + rocky + mariner + oracle + debian + ubuntu + amazon + suse + photon + distroless + + ruby + php + python + nodejs + rust + dotnet + java + go + + os + lang + + kubernetes + dockerfile + terraform + cloudformation + + docker + podman + containerd + oci + + cli + flag + + helm + report + db + deps \ No newline at end of file diff --git a/docs/community/contribute/pr.md b/docs/community/contribute/pr.md index 0014160f0c..514b375a20 100644 --- a/docs/community/contribute/pr.md +++ b/docs/community/contribute/pr.md @@ -32,16 +32,81 @@ The `type` and `scope` should always be lowercase as shown below. - **test** for adding missing tests, refactoring tests; no production code change. - **build** for updating build configuration, development tools or other changes irrelevant to the user. - **chore** for updates that do not apply to the above, such as dependency updates. +- **ci** for changes to CI configuration files and scripts +- **revert** for revert to a previous commit -**Example `` values:** +**Allowed `` values:** + +checks: + +- vuln +- misconf +- secret + +mode: + +- image +- fs +- repo +- sbom +- server + +os: - alpine - redhat +- alma +- rocky +- mariner +- oracle +- debian +- ubuntu +- amazon +- suse +- photon +- distroless + +language: + - ruby +- php - python +- nodejs +- rust +- dotnet +- java +- go + +vuln: + +- os +- lang + +config: + +- kubernetes +- dockerfile - terraform +- cloudformation + +container + +- docker +- podman +- containerd +- oci + +cli: + +- cli +- flag + +others: + +- helm - report -- etc. +- db +- deps The `` can be empty (e.g. if the change is a global or difficult to assign to a single component), in which case the parentheses are omitted.