From 747af4642fef27cc25804e3298acd53f3c6fcbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=A4hler?= Date: Mon, 23 Oct 2023 16:54:17 +0200 Subject: [PATCH] ci(repo): pull request linter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Oliver Bähler --- .github/PULL_REQUEST_TEMPLATE.md | 17 ++--------- .github/workflows/check-pr.yml | 48 ++++++++++++++++++++++++++++++++ .github/workflows/helm-test.yml | 4 +++ 3 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/check-pr.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8bb50c70..46c7cfb6 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,18 +1,7 @@ diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml new file mode 100644 index 00000000..afb2120b --- /dev/null +++ b/.github/workflows/check-pr.yml @@ -0,0 +1,48 @@ +name: "Check Pull Request" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@47b15d52c5c30e94a17ec87eb8dd51ff5221fed9 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + chore + ci + docs + feat + fix + test + sec + requireScope: false + scopes: | + all + chart + operator + manifest + website + e2e + release + repo + deps + make + wip: true + # If the PR only contains a single commit, the action will validate that + # it matches the configured pattern. + validateSingleCommit: true + # Related to `validateSingleCommit` you can opt-in to validate that the PR + # title matches a single commit to avoid confusion. + validateSingleCommitMatchesPrTitle: true diff --git a/.github/workflows/helm-test.yml b/.github/workflows/helm-test.yml index f09d9cdb..e855e57e 100644 --- a/.github/workflows/helm-test.yml +++ b/.github/workflows/helm-test.yml @@ -43,6 +43,10 @@ jobs: echo -e '\033[0;32mDocumentation up to date\033[0m ✔' fi + - name: Run chart-testing (install) + run: make helm-test + if: steps.list-changed.outputs.changed == 'true' + # ATTENTION: This is a workaround for the upcoming ApiVersion Conversions for the capsule CRDs # With this workflow the current docker image is build and loaded into kind, otherwise the install fails # In the future this must be removed and the chart-testing-action must be used