Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Introduce all checks passed workflow #74

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions .github/pull-request-template.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
<!-- Thank you for your contribution. Before you submit the pull request:
1. Follow contributing guidelines, templates, the recommended Git workflow, and any related documentation.
2. Read and submit the required Contributor Licence Agreements (https://github.com/kyma-project/community/blob/main/CONTRIBUTING.md#agreements-and-licenses).
3. Test your changes and attach their results to the pull request.
4. Update the relevant documentation.
## Description

If the pull request requires a decision, follow the [decision-making process](https://github.com/kyma-project/community/blob/main/governance.md) and replace the PR template with the [decision record template](https://github.com/kyma-project/community/blob/main/.github/ISSUE_TEMPLATE/decision-record.md).
-->
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)**
<!-- If you refer to a particular issue, provide its number. For example, `Resolves #123`, `Fixes #43`, or `See also #33`. -->
## 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.

<!--
Thank you for your contribution!

Before submitting your pull request, adhere to contributing guidelines, templates, the recommended Git workflow, and related documentation, see also https://github.com/kyma-project/community/blob/main/docs/contributing/02-contributing.md
-->
2 changes: 1 addition & 1 deletion .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
dockerfile: ./Dockerfile
context: .

Build-Image-Success:
list-images:
needs: build-image
runs-on: ubuntu-latest
steps:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/pr-all-checks-passed.yml
Original file line number Diff line number Diff line change
@@ -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'
10 changes: 0 additions & 10 deletions .github/workflows/pr-code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
7 changes: 0 additions & 7 deletions .github/workflows/pr-docu-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
16 changes: 9 additions & 7 deletions .github/workflows/pr-github-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- edited
- synchronize
- labeled
- unlabeled
workflow_dispatch:

jobs:
Expand All @@ -34,13 +35,21 @@ 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"}'
prefix=$(echo $kind_label_to_pr_title_prefix | jq -r ".\"$kind_label\"")
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
Expand All @@ -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"
Loading