From 6499793aee737fb4c919fb3832b9bebe3e8b4b18 Mon Sep 17 00:00:00 2001 From: Guilherme Henrique Crozariol Date: Tue, 31 Oct 2023 12:15:49 -0300 Subject: [PATCH] Add dependabot reviewer --- .DS_Store | Bin 0 -> 6148 bytes .github/workflows/dependabot-reviewer.yaml | 41 +++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .DS_Store create mode 100644 .github/workflows/dependabot-reviewer.yaml diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d6ff81cd767407befa01c2881d0f410c66d007e9 GIT binary patch literal 6148 zcmeHK%}T>S5T3QwrWBzEg&r5Y7Oj6p@e*Qv0V8@)sR=D@FlI}ennNk%tS{t~_&m<+ zZop~}oHy$iBNU`85i&1zt=V8gq30OF6v8l@jKX-y zM1Rpl-(G=T7(fImeENPBqUS9f#nB{fwcf>Asl2{XaVk#Dx%Y=E^V1-mPP|}zOQS2L z;;_(z@H*;e-TKzKO41-o`eU6C_4*iccM~N&m3eBK^d>sjHx8%jRJ--YY#YXP4c__$g5@hDw2~YuU6|z$+?Ws(SXvNvx6qdWx(fnvoe` z2ABb6V6_;q=YUgNt+KgVW`G&^0Ryx@NNj|z#oVCYI2s?E#?N% zgCa~SqDd9@i6Kln+NF(iE#?MIItaZo&SO_D9xp<#j&`ZTLAVCFX9k#oMFvV{Sf}&< z0)LsMkNm|H9x(&Vz&~R^lskUM!=mij`mH=VYbCY^Y$OzylY)Z!!X*F)w2w5j)A%Ln Z80T8d4bm)R*Xf9S5zvHi#|-=e10NE{OeO#T literal 0 HcmV?d00001 diff --git a/.github/workflows/dependabot-reviewer.yaml b/.github/workflows/dependabot-reviewer.yaml new file mode 100644 index 0000000..51fe2a0 --- /dev/null +++ b/.github/workflows/dependabot-reviewer.yaml @@ -0,0 +1,41 @@ +name: Dependabot reviewer + +on: pull_request_target + +permissions: + pull-requests: write + contents: write + +jobs: + review-dependabot-pr: + runs-on: ubuntu-latest + if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} + steps: + - name: Dependabot metadata + id: dependabot-metadata + uses: dependabot/fetch-metadata@v1.3.1 + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Approve patch and minor updates + if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor'}} + run: gh pr review $PR_URL --approve -b "I'm **approving** this pull request because **it includes a patch or minor update**" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Approve major updates of development dependencies + if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major' && steps.dependabot-metadata.outputs.dependency-type == 'direct:development'}} + run: gh pr review $PR_URL --approve -b "I'm **approving** this pull request because **it includes a major update of a dependency used only in development**" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Comment on major updates of non-development dependencies + if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major' && steps.dependabot-metadata.outputs.dependency-type == 'direct:production'}} + run: | + gh pr comment $PR_URL --body "I'm **not approving** this PR because **it includes a major update of a dependency used in production**" + gh pr edit $PR_URL --add-label "requires-manual-qa" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file