Skip to content

Commit

Permalink
Merge pull request #89 from seamapi/add_openapi_daily_cron
Browse files Browse the repository at this point in the history
add dependabot and relevant workflow to update, approve and merge @seamapi/* dependencies
  • Loading branch information
kainpets authored Feb 24, 2024
2 parents 624c92b + 284111f commit 55d355b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
target-branch: "main"
versioning-strategy: "auto"
allow:
- dependency-name: "@seamapi/*"
- dependency-type: production
groups:
seam:
dependency-type: production
update-types:
- patch
- minor
28 changes: 28 additions & 0 deletions .github/workflows/auto-merge-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
if: contains(steps.metadata.outputs.dependency-names, '@seamapi/http')
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit 55d355b

Please sign in to comment.