From bba03080229cf379dadbb87c80a99127cf4cda29 Mon Sep 17 00:00:00 2001 From: Sivanantham <90966311+sivanantha321@users.noreply.github.com> Date: Tue, 27 Aug 2024 15:35:36 +0530 Subject: [PATCH] Prow GitHub action debug (#20) * Add prow-github-action Signed-off-by: Sivanantham Chinnaiyan * debug Signed-off-by: Sivanantham Chinnaiyan --------- Signed-off-by: Sivanantham Chinnaiyan --- .github/labels.yaml | 31 +++++++++++++++++++++++ .github/workflows/prow-github.yml | 30 ++++++++++++++++++++++ .github/workflows/prow-pr-automerge.yml | 25 ++++++++++++++++++ .github/workflows/prow-pr-remove-lgtm.yml | 14 ++++++++++ 4 files changed, 100 insertions(+) create mode 100644 .github/labels.yaml create mode 100644 .github/workflows/prow-github.yml create mode 100644 .github/workflows/prow-pr-automerge.yml create mode 100644 .github/workflows/prow-pr-remove-lgtm.yml diff --git a/.github/labels.yaml b/.github/labels.yaml new file mode 100644 index 00000000000..26e66e3668f --- /dev/null +++ b/.github/labels.yaml @@ -0,0 +1,31 @@ +# Labels for labeling issues and pull requests using GitHub prow action. +kind: + - 'bug' + - 'discussion' + - 'feature' + - 'process' + - 'question' + +area: + - 'api' + - 'azure' + - 'docs' + - 'example' + - 'gcp' + - 'inference' + - 'infrastructure-feature' + - 'logging' + - 'operator' + - 'performance' + - 'testing' + - 'project-health' + - 'servingruntime' + - 'inferencegraph' + - 'storage' + - 'inferenceservice' + - 'control-plane' + +priority: + - 'p0' + - 'p1' + - 'p2' diff --git a/.github/workflows/prow-github.yml b/.github/workflows/prow-github.yml new file mode 100644 index 00000000000..eaa25b7742d --- /dev/null +++ b/.github/workflows/prow-github.yml @@ -0,0 +1,30 @@ +# Run specified actions or jobs for issue and PR comments + +name: "Prow github actions" +on: + issue_comment: + types: [created] + +jobs: + prow-execute: + runs-on: ubuntu-latest + steps: + - uses: jpmcb/prow-github-actions@v1.1.3 + with: + prow-commands: '/assign + /unassign + /approve + /retitle + /area + /kind + /priority + /remove + /lgtm + /close + /reopen + /lock + /milestone + /hold + /cc + /uncc' + github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/prow-pr-automerge.yml b/.github/workflows/prow-pr-automerge.yml new file mode 100644 index 00000000000..7b336b6d9e9 --- /dev/null +++ b/.github/workflows/prow-pr-automerge.yml @@ -0,0 +1,25 @@ +# This Github workflow will check every hour for PRs with the lgtm label and will attempt to automatically merge them. +# If the hold label is present, it will block automatic merging. + +name: "Prow merge on lgtm label" +on: +# schedule: +# - cron: "0 * * * *" # every hour + pull_request_target: + types: + - labeled + +jobs: + print-event: + runs-on: ubuntu-latest + steps: + - run: echo "${{ toJson(github.event) }}" + auto-merge: + runs-on: ubuntu-latest + if: contains(github.event.label.name, 'lgtm') + steps: + - uses: jpmcb/prow-github-actions@v1.1.3 + with: + jobs: 'lgtm' + github-token: "${{ secrets.GITHUB_TOKEN }}" + merge-method: 'squash' diff --git a/.github/workflows/prow-pr-remove-lgtm.yml b/.github/workflows/prow-pr-remove-lgtm.yml new file mode 100644 index 00000000000..f9332f41416 --- /dev/null +++ b/.github/workflows/prow-pr-remove-lgtm.yml @@ -0,0 +1,14 @@ +# This workflow will remove the lgtm label from a PR that gets updated. +# This prevents any un-reviewed code from being automatically merged by the lgtm-merger mechanism. + +name: "Prow remove lgtm label" +on: pull_request + +jobs: + remove-lgtm: + runs-on: ubuntu-latest + steps: + - uses: jpmcb/prow-github-actions@v1.1.3 + with: + jobs: 'lgtm' + github-token: "${{ secrets.GITHUB_TOKEN }}"