Skip to content

Commit

Permalink
add autoreview for helm release
Browse files Browse the repository at this point in the history
  • Loading branch information
ying-jeanne committed Dec 16, 2024
1 parent b27bad3 commit 2c5be0a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/dependabot_reviewer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
dependabot-reviewer:
runs-on: ubuntu-latest

if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} || ${{ github.event.pull_request.user.login == 'grafanabot' }}

steps:
- name: Checkout Repository
Expand Down Expand Up @@ -53,21 +53,23 @@ jobs:
echo "allInAllowlist=false" >> $GITHUB_OUTPUT
fi
- name: Helm Weekly release
id: helm-weekly-release
if : contains(github.ref, 'helm-chart-weekly-')
run: echo "isHelmRelease=true" >> $GITHUB_OUTPUT

- name: Approve and auto-merge
if: steps.check-allowlist.conclusion == 'success' && steps.check-allowlist.outputs.allInAllowlist == 'true'
if: steps.check-allowlist.conclusion == 'success' && steps.check-allowlist.outputs.allInAllowlist == 'true' || (steps.helm-weekly-release.conclusion == 'success' && steps.helm-weekly-release.outputs.isHelmRelease == 'true')
run: |
gh pr merge --auto --squash "$PR_URL"
gh pr review $PR_URL \
--approve -b "**I'm approving** this pull request because it includes a patch or minor \
update to dependencies that are already in the allowlist.
The reason this library is in the allowlist is that ${{ steps.check-allowlist.outputs.reasons}}"
--approve -b "**I'm approving** this pull request, since it is a helm release or all libraries are in the allowlist."
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GH_BOT_ACCESS_TOKEN}}

- name: Manual review is required
if: steps.check-allowlist.conclusion != 'success' || steps.check-allowlist.outputs.allInAllowlist == 'false'
if: steps.helm-weekly-release.conclusion == 'skip' && (steps.check-allowlist.conclusion != 'success' || steps.check-allowlist.outputs.allInAllowlist == 'false')
run: |
gh pr comment $PR_URL --body "**This library is not auto-approved**
Expand Down

0 comments on commit 2c5be0a

Please sign in to comment.