Skip to content

Commit

Permalink
[CI] Add auto approval/merge for helm weekly release (#10254)
Browse files Browse the repository at this point in the history
* add autoreview for helm release

* change action name
  • Loading branch information
ying-jeanne authored Dec 17, 2024
1 parent 97d684e commit ddb0f58
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 109 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/allowlist.json

This file was deleted.

83 changes: 0 additions & 83 deletions .github/workflows/dependabot_reviewer.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/grafanabot_reviewer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Auto-review Grafanabot PRs
on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot-reviewer:
runs-on: ubuntu-latest

if: ${{ github.event.pull_request.user.login == 'grafanabot' }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Approve and auto-merge
id: auto-merge
if: contains(github.event.pull_request.head.ref, 'helm-chart-weekly-')
run: |
gh pr merge --auto --squash "$PR_URL"
gh pr review $PR_URL \
--approve -b "**I'm approving** this pull request, since it is a helm release."
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GH_BOT_ACCESS_TOKEN}}

- name: Manual review is required
if: steps.auto-merge.conclusion != 'success'
run: |
gh pr comment $PR_URL --body "**This PR from grafanabot requires manual review.**"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit ddb0f58

Please sign in to comment.