Skip to content

Commit e46693e

Browse files
high-moctaneclaude
andcommitted
ci: Add GitHub Actions CI and dependabot with auto-merge
- Add CI workflow: build and test on push/PR to main - Add dependabot for weekly Go module updates (Thursday JST) - Add auto-merge workflow for dependabot PRs - Group all dependencies into single PR ✨ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Sakura 🌸 <noreply@anthropic.com>
1 parent 74bd1be commit e46693e

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
day: thursday
8+
timezone: Asia/Tokyo
9+
commit-message:
10+
prefix: "deps"
11+
groups:
12+
all-dependencies:
13+
patterns:
14+
- "*"

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version-file: go.mod
19+
20+
- name: Build
21+
run: go build ./...
22+
23+
- name: Test
24+
run: go test ./...
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Dependabot auto-merge
2+
3+
on: pull_request
4+
5+
permissions:
6+
contents: write
7+
pull-requests: write
8+
9+
jobs:
10+
dependabot:
11+
runs-on: ubuntu-latest
12+
if: github.actor == 'dependabot[bot]'
13+
steps:
14+
- name: Dependabot metadata
15+
id: metadata
16+
uses: dependabot/fetch-metadata@v2
17+
with:
18+
github-token: "${{ secrets.GITHUB_TOKEN }}"
19+
20+
- name: Enable auto-merge for Dependabot PRs
21+
run: gh pr merge --auto --squash "$PR_URL"
22+
env:
23+
PR_URL: ${{ github.event.pull_request.html_url }}
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)