From 18ef148e66d7a707d9d62cd5e92c40f82e13666a Mon Sep 17 00:00:00 2001 From: Andreas Thaler Date: Tue, 1 Oct 2024 15:38:01 +0200 Subject: [PATCH 1/2] chore: Introduce all checks passed workflow --- .github/workflows/build-image.yml | 2 +- .github/workflows/pr-all-checks-passed.yml | 25 ++++++++++++++++++++++ .github/workflows/pr-code-checks.yml | 10 --------- .github/workflows/pr-docu-checks.yml | 7 ------ .github/workflows/pr-github-checks.yml | 16 ++++++++------ 5 files changed, 35 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/pr-all-checks-passed.yml diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 3575aa8..c9c4246 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -17,7 +17,7 @@ jobs: dockerfile: ./Dockerfile context: . - Build-Image-Success: + list-images: needs: build-image runs-on: ubuntu-latest steps: diff --git a/.github/workflows/pr-all-checks-passed.yml b/.github/workflows/pr-all-checks-passed.yml new file mode 100644 index 0000000..5ee8f45 --- /dev/null +++ b/.github/workflows/pr-all-checks-passed.yml @@ -0,0 +1,25 @@ +name: All Checks passed +on: + pull_request: + types: + [ + opened, + synchronize, + reopened, + ready_for_review, + edited, + labeled, + milestoned, + ] +jobs: + all-checks: + runs-on: ubuntu-latest + permissions: + checks: read + contents: read + steps: + - uses: wechuli/allcheckspassed@2e5e8bbc775f5680ed5d02e3a22e2fc7219792ac + with: + delay: '5' + retries: '30' + polling_interval: '1' diff --git a/.github/workflows/pr-code-checks.yml b/.github/workflows/pr-code-checks.yml index 4275903..f39dfab 100644 --- a/.github/workflows/pr-code-checks.yml +++ b/.github/workflows/pr-code-checks.yml @@ -53,13 +53,3 @@ jobs: env: PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }} PULL_HEAD_SHA: ${{ github.event.pull_request.head.sha }} - - PR-Code-Checks-Success: - needs: - - unit-tests - - linting - - gitleaks - runs-on: ubuntu-latest - steps: - - name: Success - run: echo "All checks passed successfully" diff --git a/.github/workflows/pr-docu-checks.yml b/.github/workflows/pr-docu-checks.yml index ab99f61..eea62a2 100644 --- a/.github/workflows/pr-docu-checks.yml +++ b/.github/workflows/pr-docu-checks.yml @@ -24,10 +24,3 @@ jobs: max-depth: -1 check-modified-files-only: "yes" base-branch: ${{ github.base_ref }} - - PR-Docu-Checks-Success: - needs: markdown-link-check - runs-on: ubuntu-latest - steps: - - name: Success - run: echo "All checks passed" diff --git a/.github/workflows/pr-github-checks.yml b/.github/workflows/pr-github-checks.yml index 701c2c3..bf47013 100644 --- a/.github/workflows/pr-github-checks.yml +++ b/.github/workflows/pr-github-checks.yml @@ -11,6 +11,7 @@ on: - edited - synchronize - labeled + - unlabeled workflow_dispatch: jobs: @@ -34,6 +35,7 @@ jobs: GH_TOKEN: ${{ github.token }} - name: Check if kind label matches pr title prefix + if: always() run: | kind_label=$( gh api --jq '.labels.[].name' /repos/${{ github.repository }}/pulls/${{ github.event.number }} | grep '^kind/') kind_label_to_pr_title_prefix='{"kind/bug":"fix","kind/feature":"feat","kind/docs":"docs","kind/chore":"chore","kind/flaky-test":"test","kind/missing-test":"test","kind/failing-test":"test","kind/deps":"deps"}' @@ -41,6 +43,13 @@ jobs: echo "${{ github.event.pull_request.title }}" | grep '^'$prefix || (echo "PR title should start with $prefix"; exit 1) env: GH_TOKEN: ${{ github.token }} + - name: Check for do-not-merge label + if: always() + run: | + gh api --jq '.labels.[].name' /repos/${{ github.repository }}/pulls/${{ github.event.number }} | \ + grep -q '^do-not-merge/$' && (echo "do-not-merge label detected -> preventing merge by failing the job"; exit 1) + env: + GH_TOKEN: ${{ github.token }} pr-title-check: runs-on: ubuntu-latest @@ -59,10 +68,3 @@ jobs: test requireScope: false subjectPattern: ^([A-Z].*[^.]|bump .*)$ - - PR-Github-Checks-Success: - runs-on: ubuntu-latest - needs: [pr-label-check, pr-title-check] - steps: - - name: PR Github Checks Success - run: echo "PR Github Checks Success" From 4066645fc682b1adcf57377c7e105505a106e804 Mon Sep 17 00:00:00 2001 From: Andreas Thaler Date: Tue, 1 Oct 2024 15:39:30 +0200 Subject: [PATCH 2/2] fix --- .github/pull-request-template.md | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/pull-request-template.md b/.github/pull-request-template.md index 28e137f..337f28b 100644 --- a/.github/pull-request-template.md +++ b/.github/pull-request-template.md @@ -1,19 +1,23 @@ - +Changes proposed in this pull request (what was done and why): -**Description** +- -Changes proposed in this pull request: +Changes refer to particular issues, PRs or documents: -- ... -- ... -- ... +- -**Related issue(s)** - +## Traceability +- [ ] The PR is linked to a GitHub issue. +- [ ] The follow-up issues (if any) are linked in the `Related Issues` section. +- [ ] If the change is user-facing, the documentation has been adjusted. +- [ ] If a CRD is changed, the corresponding Busola ConfigMap has been adjusted. +- [ ] The feature is unit-tested. +- [ ] The feature is e2e-tested. + +