From d9e7b20c30a40ba1cf467c504927b832d4d3edf1 Mon Sep 17 00:00:00 2001 From: Christian Zunker Date: Tue, 12 Nov 2024 15:09:19 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Auto=20approve=20provider=20rele?= =?UTF-8?q?ase=20PRs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian Zunker --- .github/workflows/pr-test-lint.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/pr-test-lint.yml b/.github/workflows/pr-test-lint.yml index f04d06f84..c8adbfe95 100644 --- a/.github/workflows/pr-test-lint.yml +++ b/.github/workflows/pr-test-lint.yml @@ -172,6 +172,29 @@ jobs: fail-on-alert: true save-data-file: false alert-threshold: '150%' + + go-auto-approve: + runs-on: ubuntu-latest + needs: [golangci-lint, go-test, go-test-integration, go-bench, go-mod] + # For now, we only auto approve and merge provider release PRs created by mondoo-tools. + # We have to check the commit author, because the PR is created by "github-actions[bot]" + # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#startswith + if: ${{ startsWith(github.ref, 'refs/heads/version/providers_update_') && github.event.commits[0].author.username == 'mondoo-tools' }} + permissions: + contents: write + pull-requests: write + steps: + # figure out the PR for this commit + - uses: cloudposse-github-actions/get-pr@v1.0.1 + id: pr + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + filterOutClosed: true + filterOutDraft: true + - name: Approve a PR + uses: fastify/github-action-merge-dependabot@v3 + with: + pr-number: ${{ steps.pr.outputs.number }} event_file: name: "Store event file"