Skip to content

Commit

Permalink
chore: Introduce all checks passed workflow (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-thaler authored Oct 1, 2024
1 parent b07bc6e commit ddc9eb5
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 28 deletions.
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'
4 changes: 2 additions & 2 deletions .github/workflows/pr-build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ jobs:
build-args: ${{ needs.envs.outputs.build-args }}
tags: ${{ needs.envs.outputs.tags }}

Build-Image-Success:
list-images:
needs: build-image
runs-on: ubuntu-latest
steps:
- name: List images
run: |
echo "${{ needs.build-image.outputs.images }}"
echo "${{ needs.build-image.outputs.images }}"
12 changes: 0 additions & 12 deletions .github/workflows/pr-code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,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:
- checks
- unit-tests
- coverage
- build
- gitleaks
runs-on: ubuntu-latest
steps:
- run: echo "All checks passed"
name: All checks passed
6 changes: 0 additions & 6 deletions .github/workflows/pr-docu-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,3 @@ jobs:
run: |
md-check-link -q -n 8 -c https://raw.githubusercontent.com/kyma-project/md-check-link/main/.mlc.config.json ./
PR-Docu-Checks:
needs: markdown-link-check
runs-on: ubuntu-latest
steps:
- name: Success
run: echo "All checks passed"
18 changes: 10 additions & 8 deletions .github/workflows/pr-github-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- edited
- synchronize
- labeled
- milestoned
- unlabeled
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -44,6 +44,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"}'
Expand All @@ -52,6 +53,14 @@ jobs:
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
steps:
Expand All @@ -69,10 +78,3 @@ jobs:
test
requireScope: false
subjectPattern: ^([A-Z].*[^.]|bump .*)$

PR-Github-Checks-Success:
needs: [pr-milestone-check, pr-label-check, pr-title-check]
runs-on: ubuntu-latest
steps:
- name: PR Github Checks Success
run: echo "All checks passed"

0 comments on commit ddc9eb5

Please sign in to comment.