Skip to content
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
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
commit-message:
prefix: ":arrow_up:"
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
commit-message:
prefix: ":arrow_up:"
31 changes: 18 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
name: CI
on: [push, pull_request]

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
build:
ci:
name: CI
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.17"]
name: Go ${{ matrix.go }} sample
steps:
- uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v2
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: ${{ matrix.go }}
- run: |
go build
go test ./...
go-version: stable
- name: Format
run: test -z "$(gofmt -l .)"
- run: go vet ./...
- run: go build ./...
- run: go test -race ./...
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:
types:
- opened
- reopened
- synchronize

permissions:
contents: write
pull-requests: write

jobs:
dependabot-auto-merge:
name: Dependabot Auto Merge
runs-on: ubuntu-latest

if: >-
github.event.pull_request.user.login == 'dependabot[bot]'

steps:
# Every update type, majors included: the ruleset's required CI check decides
# whether it actually merges (auto-merge waits for it).
#
# The built-in token can never merge a PR that edits .github/workflows/*
# ("refusing to allow a GitHub App to create or update workflow ... without workflows
# permission"), which is what Dependabot's action-version bumps are. Those are left for a
# human or the sweep tool instead of failing this job.
- name: Enable auto-merge
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
if gh pr diff "$PR_URL" --name-only | grep -q '^\.github/workflows/'; then
echo "::notice::This PR edits workflow files, which the built-in token cannot merge. Merge it by hand."
exit 0
fi
gh pr merge --auto --squash "$PR_URL"
15 changes: 6 additions & 9 deletions .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
- uses: actions/setup-go@v7
with:
go-version: 1.17
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
go-version: stable
- uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: latest
args: release --rm-dist
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading