Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Update dependabot configuration #77

Merged
merged 8 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ version: 2
updates:
- package-ecosystem: "gomod"
directory: "/" # Location of package manifests
default_labels:
- "🤖 Dependencies"
labels:
- "🤖 Dependencies"
schedule:
interval: "daily"
automerged_updates:
- match:
dependency_name: "gofiber/fiber/*"
interval: daily
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
labels:
- "🤖 Dependencies"
39 changes: 39 additions & 0 deletions .github/workflows/dependabot_automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
wait_for_checks:
runs-on: ubuntu-latest
steps:
- name: Wait for check is finished
uses: lewagon/wait-on-check-action@v1.0.0
id: wait_for_checks
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
running-workflow-name: wait_for_checks
check-regexp: Tests
repo-token: ${{ secrets.PR_TOKEN }}
wait-interval: 10
dependabot:
needs: [wait_for_checks]
name: Dependabot auto-merge
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.3.4
with:
github-token: "${{ secrets.PR_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.PR_TOKEN}}
40 changes: 23 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
on: [push, pull_request]
name: Test
on: [ push, pull_request ]
name: Tests
jobs:
Build:
strategy:
matrix:
go-version: [1.14.x]
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Fetch Repository
uses: actions/checkout@v2
- name: Run Test
run: go test -race
Tests:
name: Tests
strategy:
matrix:
go-version:
- 1.15.x
- 1.16.x
- 1.18.x
platform:
- ubuntu-latest
- windows-latest
runs-on: '${{ matrix.platform }}'
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Fetch Repository
uses: actions/checkout@v3
- name: Run Test
run: go test -race