From 0e677a97b37f389d0d71325855353b638d2482be Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Tue, 23 Jul 2024 13:40:43 +0200 Subject: [PATCH] ci: add automerge workflow and simplify settings --- .github/settings.yml | 57 +-------------------------------- .github/workflows/automerge.yml | 49 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/automerge.yml diff --git a/.github/settings.yml b/.github/settings.yml index 13c389f6..0ab732fe 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -21,62 +21,6 @@ repository: enable_automated_security_fixes: true enable_vulnerability_alerts: true -labels: - - name: bug - color: fc2929 - description: Something isn't working - - name: duplicate - color: cccccc - description: This issue or pull request already exists - - name: enhancement - color: 84b6eb - description: New feature or request - - name: good first issue - color: 7057ff - description: Good for newcomers - - name: help wanted - color: 159818 - description: Extra attention is needed - - name: invalid - color: e6e6e6 - description: This doesn't seem right - - name: question - color: cc317c - description: Further information is requested - - name: renovate - color: 1d76db - description: Automated action from Renovate - - name: wontfix - color: 5319e7 - description: This will not be worked on - - name: hacktoberfest - color: d4c5f9 - description: Contribution at Hacktoberfest appreciated - - name: ready - color: ededed - description: This is ready to be worked on - - name: in progress - color: ededed - description: This is currently worked on - - name: infra - color: 006b75 - description: Related to the infrastructure - - name: lint - color: fbca04 - description: Related to linting tools - - name: poc - color: c2e0c6 - description: Proof of concept for new feature - - name: rebase - color: ffa8a5 - description: Branch requires a rebase - - name: third-party - color: e99695 - description: Depends on third-party tool or library - - name: translation - color: b60205 - description: Change or issue related to translations - branches: - name: master protection: @@ -87,6 +31,7 @@ branches: enforce_admins: false restrictions: apps: + - dockhippie - renovate users: [] teams: diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 00000000..9623fa0a --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,49 @@ +--- +name: automerge + +"on": + workflow_dispatch: + pull_request: + branches: + - master + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + + steps: + - name: Generate token + id: token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.TOKEN_EXCHANGE_APP }} + installation_retrieval_mode: id + installation_retrieval_payload: ${{ secrets.TOKEN_EXCHANGE_INSTALL }} + private_key: ${{ secrets.TOKEN_EXCHANGE_KEY }} + permissions: >- + {"contents": "write", "pull_requests": "write", "issues": "write"} + + - name: Fetch metadata + id: metadata + uses: dependabot/fetch-metadata@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Approve request + id: approve + run: gh pr review --approve "${{github.event.pull_request.html_url}}" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Enable automerge + id: automerge + run: gh pr merge --rebase --auto "${{github.event.pull_request.html_url}}" + env: + GH_TOKEN: ${{ steps.token.outputs.token }} + +...