From 2c5be0a660afd9b01f434388892a582c812f566b Mon Sep 17 00:00:00 2001 From: Ying WANG Date: Mon, 16 Dec 2024 12:18:53 +0100 Subject: [PATCH] add autoreview for helm release --- .github/workflows/dependabot_reviewer.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dependabot_reviewer.yml b/.github/workflows/dependabot_reviewer.yml index 03bbf286321..2ed0c8c5266 100644 --- a/.github/workflows/dependabot_reviewer.yml +++ b/.github/workflows/dependabot_reviewer.yml @@ -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 @@ -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**