Skip to content

Commit

Permalink
ci: add automerge workflow and simplify settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Jul 23, 2024
1 parent d002aea commit 3a41a7b
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 56 deletions.
57 changes: 1 addition & 56 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -89,6 +33,7 @@ branches:
enforce_admins: false
restrictions:
apps:
- kustomhippie
- renovate
users: []
teams:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -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 }}

...

0 comments on commit 3a41a7b

Please sign in to comment.