Skip to content

Commit 7573a47

Browse files
committed
feat: auto approve dependabot PRs
1 parent a70e47d commit 7573a47

6 files changed

Lines changed: 110 additions & 4 deletions

File tree

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Autodetect text files and forces unix eols, so Windows does not break them
2+
* text=auto eol=lf
3+
4+
# Force images/fonts to be handled as binaries
5+
*.jpg binary
6+
*.jpeg binary
7+
*.gif binary
8+
*.png binary
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Dependabot Auto Merge
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
concurrency:
15+
group: dependabot-auto-merge-${{ github.event.pull_request.number }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
auto-approve-and-merge:
20+
if: github.event.pull_request.user.login == 'dependabot[bot]'
21+
runs-on: ubuntu-24.04
22+
steps:
23+
- name: Approve Dependabot PR
24+
env:
25+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
PR_URL: ${{ github.event.pull_request.html_url }}
27+
run: gh pr review --approve "$PR_URL"
28+
29+
- name: Enable auto-merge for Dependabot PRs
30+
env:
31+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
PR_URL: ${{ github.event.pull_request.html_url }}
33+
run: gh pr merge --auto "$PR_URL"

.yamllint

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# yamllint config for this repo.
2+
#
3+
# Scope: today only `make lint` points yamllint at .github/workflows, so this
4+
# config is tuned for GitHub Actions workflow files. If we add more YAML to the
5+
# repo, revisit the rules below.
6+
#
7+
# Indent policy: 2 spaces, matching the rest of the codebase (ruff also runs at
8+
# indent-width = 2). Sequences ("- step") indent consistently under their key.
9+
extends: default
10+
11+
rules:
12+
indentation:
13+
spaces: 2
14+
indent-sequences: consistent
15+
check-multi-line-strings: false
16+
17+
# GitHub Actions uses `on:` as a mapping key. YAML 1.1 treats on/off/yes/no
18+
# as booleans, which would otherwise trigger truthy warnings. Whitelist `on`
19+
# so the rest of the truthy rule (catching stray `yes`/`no` values) still
20+
# protects us.
21+
truthy:
22+
allowed-values: ["true", "false", "on"]
23+
24+
# Workflow `if:` expressions and `run:` one-liners frequently exceed any
25+
# sensible line-length cap.
26+
line-length: disable
27+
28+
# Workflow files don't carry a `---` document marker.
29+
document-start: disable
30+
31+
# Inline `# v1.2.3` comments after action SHAs are intentional pinning notes;
32+
# don't require them to align with surrounding content.
33+
comments-indentation: disable
34+
35+
comments:
36+
require-starting-space: true
37+
min-spaces-from-content: 1

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ test:
1818
format:
1919
uv run ruff format .
2020

21-
# Lint all Python: style, imports, docstrings, and bug-prone patterns.
21+
# Lint all Python: style, imports, docstrings, and bug-prone patterns. Also
22+
# lints the GitHub Actions workflow YAML (2-space indent enforced; see
23+
# .yamllint at the repo root).
2224
lint:
2325
uv run ruff check .
26+
uv run yamllint .github/workflows
2427

2528
# Dry-run the npm package for every publishable skill (CI does the real publish
2629
# on merge). Only the root skills/ tree publishes; the .github/skills/ meta-skills

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ dependencies = [
1111
dev = [
1212
"pytest>=9.0.3",
1313
"ruff>=0.15.16",
14+
"yamllint>=1.37.1",
1415
]
1516

1617
[tool.uv]

uv.lock

Lines changed: 27 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)