Skip to content

Commit

Permalink
ci(workflow): add auto-approve job for dependabot PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
tgragnato committed Feb 10, 2025
1 parent 5c2019b commit c15342f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 15 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/commit-lint.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Pull Requests

on: [pull_request]

jobs:

commit-lint:
name: Commits linter
runs-on: ubuntu-latest

permissions:
actions: read
contents: read
packages: read
security-events: read
pull-requests: read

steps:

- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event.pull_request.commits }}
ref: ${{ github.event.pull_request.head.sha }}

- name: Commits linter
uses: bugbundle/commits@v1.1.0
id: commits

- name: Preview the version
run: echo ${{ steps.commits.outputs.major }}.${{ steps.commits.outputs.minor }}.${{ steps.commits.outputs.patch }}

auto-approve:
name: Auto Approve
runs-on: ubuntu-latest

if: ${{ github.actor == 'dependabot[bot]' }}

permissions:
actions: read
contents: read
packages: read
security-events: read
pull-requests: write

steps:
- uses: "fastify/github-action-merge-dependabot@v3"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
approve-only: true
use-github-auto-merge: false

0 comments on commit c15342f

Please sign in to comment.