From 1c67fca24c4e21e8b59e9da7760691782edfd314 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Tue, 23 Jul 2024 13:49:28 +0200 Subject: [PATCH] ci: add automerge workflow and simplify settings --- .github/settings.yml | 65 +-------------------------------- .github/workflows/automerge.yml | 49 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/automerge.yml diff --git a/.github/settings.yml b/.github/settings.yml index d0b4e7f..643e9aa 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -21,70 +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 - -teams: - - name: admins - permission: admin - - name: boots - permission: admin - - name: members - permission: maintain - branches: - name: master protection: @@ -96,6 +32,7 @@ branches: enforce_admins: false restrictions: apps: + - toolhippie - renovate users: [] teams: diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..2c9e5e6 --- /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@v2 + 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 }} + +...