Skip to content

Commit c047d23

Browse files
committed
feat: ci
1 parent 71294b8 commit c047d23

17 files changed

Lines changed: 681 additions & 500 deletions

File tree

.github/.gitleaks.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
[extend]
22
useDefault = true
3+
4+
[[allowlists]]
5+
description = "Global allowlist"
6+
paths = ['''^\.zed/''']

.github/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Hand-crafted [skills](https://skills.sh) for agents, built from workflows I kept
55
| Skill | What it does |
66
| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77
| [multilingual-caption-video](/skills/multilingual-caption-video) | Add captions / subtitles to a video in your desired language. |
8-
| ~screencast~ (Use CDP's new `--experimentalScreencast`) |
8+
| ~~screencast~~ (Use CDP's new `--experimentalScreencast`) |
99
| [manipulating-video](/skills/manipulating-video) | Manipulate video files with [`ffmpeg`](https://github.com/ffmpeg/ffmpeg) — speed up/slow down, resize, compress, convert formats, extract audio, convert to GIF, trim, merge, and more. |
1010
| [upload-image](/skills/upload-image) | Uploads images to [imgbb](https://ibb.co) — local files, URLs, SVGs, base64, whatever. No more manual hosting. |
1111
| [terminal-recording](/skills/terminal-recording) | Record, upload, and GIF-convert terminal sessions with [`asciinema`](https://github.com/asciinema/asciinema) and [`agg`](https://github.com/asciinema/agg). |

.github/actions/checks/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Checks
2+
description: "Run format, lint, type check, and build checks."
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: "Setup mise 🐭"
8+
uses: jdx/mise-action@dad1bfd3df957f44999b559dd69dc1671cb4e9ea # v4.2.1
9+
with:
10+
cache: false
11+
12+
- name: "Install Dependencies"
13+
shell: bash
14+
run: bun install --frozen-lockfile
15+
16+
- name: "Run CI Tasks"
17+
shell: bash
18+
run: mise ci

.github/workflows/check.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Checks
2+
3+
on:
4+
push:
5+
branches: # all but main
6+
- "*"
7+
- "!main"
8+
pull_request:
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
env:
15+
UV_PREVIEW: 1
16+
DISABLE_TELEMETRY: 1
17+
NODE_ENV: "production"
18+
MISE_EXPERIMENTAL: true
19+
NODE_OPTIONS: "--disable-warning=ExperimentalWarning --disable-warning=DeprecationWarning"
20+
21+
permissions: {}
22+
23+
jobs:
24+
check:
25+
name: Check
26+
runs-on: ["ubuntu-latest"]
27+
timeout-minutes: 5
28+
permissions:
29+
contents: read
30+
steps:
31+
- name: "🔑 Checkout"
32+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
33+
with:
34+
persist-credentials: false
35+
36+
- name: Checks
37+
uses: ./.github/actions/checks

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ _
2929
package-lock.json
3030
pnpm-lock.yaml
3131
yarn.lock
32+
.venv

.zed/settings.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@
126126
"env": { "NO_COLOR": "true" },
127127
"ignore_system_version": false
128128
}
129-
},
130-
"gopls": {
131-
"binary": {
132-
"ignore_system_version": false
133-
}
134129
}
135130
},
136131
"hidden_files": [

bun.lock

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

hk.pkl

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
amends "package://github.com/jdx/hk/releases/download/v1.51.0/hk@1.51.0#/Config.pkl"
2+
3+
import "package://github.com/jdx/hk/releases/download/v1.51.0/hk@1.51.0#/Builtins.pkl"
4+
5+
// https://hk.jdx.dev/configuration.html
6+
7+
walk_ignore = true
8+
9+
local linters = new Mapping<String, Step> {
10+
["ruff"] = (Builtins.ruff) {
11+
exclude = List("**/.agents/**")
12+
check = "uv run ruff check --force-exclude {{ files }}"
13+
fix = "uv run ruff check --force-exclude --fix {{ files }}"
14+
}
15+
["oxlint"] = (Builtins.ox_lint) {
16+
check = "bun x oxlint --deny-warnings {{ files }}"
17+
fix = "bun x oxlint --deny-warnings --fix {{ files }}"
18+
}
19+
["ghalint-action"] = Builtins.ghalint_action
20+
["ghalint-workflow"] = (Builtins.ghalint_workflow) {
21+
check =
22+
#"""
23+
tmp="$(mktemp -d)"
24+
trap 'rm -rf "$tmp"' EXIT
25+
tar -cf - -- {{ files }} | tar -xf - -C "$tmp"
26+
cd "$tmp"
27+
ghalint run
28+
"""#
29+
}
30+
["actionlint"] = (Builtins.actionlint) {
31+
glob =
32+
List(
33+
".github/workflows/*.yml",
34+
".github/workflows/*.yaml",
35+
)
36+
}
37+
["betterleaks"] = (Builtins.betterleaks) {
38+
exclude = List("users/o/thaw/thaw.json")
39+
}
40+
["gitleaks"] = (Builtins.gitleaks) {
41+
check =
42+
#"""
43+
root="$PWD"
44+
tmp="$(mktemp -d)"
45+
trap 'rm -rf "$tmp"' EXIT
46+
tar -cf - -- {{ files }} | tar -xf - -C "$tmp"
47+
cd "$tmp"
48+
gitleaks dir --redact --config "$root/.github/.gitleaks.toml" --verbose --no-banner .
49+
"""#
50+
}
51+
["shellcheck"] = (Builtins.shellcheck) {
52+
exclude = List("**/skills/**")
53+
}
54+
["pyrefly"] {
55+
glob = List("pyproject.toml")
56+
exclude = List("**/.agents/**")
57+
workspace_indicator = "pyproject.toml"
58+
check = "sh -c 'cd \"{{ workspace }}\" && uv run pyrefly check --preset=all'"
59+
}
60+
["validate-skills"] {
61+
glob = List("skills/*/SKILL.md")
62+
check =
63+
"bash -c 'for dir in skills/*/; do uvx --from skills-ref agentskills validate \"$dir\"; done'"
64+
}
65+
}
66+
67+
local formatters = new Mapping<String, Step> {
68+
["pkl-format"] = (Builtins.pkl_format) {
69+
glob = List("*.pkl", "**/*.pkl")
70+
}
71+
["ruff-format"] = (Builtins.ruff_format) {
72+
check_diff = "uv run ruff format --quiet --force-exclude --diff {{ files }}"
73+
fix = "uv run ruff format --quiet --force-exclude {{ files }}"
74+
}
75+
["shfmt"] = Builtins.shfmt
76+
["oxfmt"] = (Builtins.oxfmt) {
77+
exclude = List("*.toml")
78+
check = "bun x oxfmt --check {{ files }}"
79+
check_list_files = "bun x oxfmt --list-different {{ files }}"
80+
fix = "bun x oxfmt --write {{ files }}"
81+
}
82+
// tombi --diff is ANSI stderr, not git-applyable; use plain check + fix
83+
["tombi-format"] = (Builtins.tombi_format) {
84+
check_diff = null
85+
check = "tombi format --check {{ files }}"
86+
fix = "tombi format {{ files }}"
87+
}
88+
}
89+
90+
local allSteps = (formatters) {
91+
for (name, step in linters) {
92+
[name] = step
93+
}
94+
}
95+
96+
hooks {
97+
["pre-commit"] {
98+
fix = true
99+
stash = "git"
100+
steps = allSteps
101+
}
102+
// formatters only — `just fmt` / `hk fix --all`
103+
["fix"] {
104+
fix = true
105+
steps = formatters
106+
}
107+
// linters only — `just lint` / `hk check --all`
108+
["check"] {
109+
steps = linters
110+
}
111+
}

mise.toml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,32 @@ color = true
55
pipx.uvx = true
66
experimental = true
77
color_theme = "charm"
8-
minimum_release_age_excludes = ["bun", "node", "npm:oxfmt", "npm:oxlint"]
8+
minimum_release_age_excludes = ["hk", "bun", "node", "npm:oxfmt", "npm:oxlint"]
9+
10+
[env]
11+
HK_MISE = 1
12+
UV_PREVIEW = 1
913

1014
[tools]
1115
uv = "latest"
1216
bun = "latest"
1317
node = "latest"
1418
tombi = "latest"
1519
usage = "latest"
20+
ghalint = "latest"
21+
gitleaks = "latest"
22+
actionlint = "latest"
23+
betterleaks = "latest"
1624
shfmt = "latest"
17-
"npm:oxfmt" = "latest"
18-
"npm:oxlint" = "latest"
25+
pkl = "latest"
26+
27+
[hooks]
28+
postinstall = "hk install --mise"
29+
30+
[tasks.check]
31+
description = "format & lint files"
32+
run = "hk fix --all && hk check --all"
33+
34+
[tasks.ci]
35+
description = "run CI tasks"
36+
run = "hk fix --all && hk check --all"

package.json

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,10 @@
1414
"lint": "oxlint --fix",
1515
"format": "oxfmt --write",
1616
"check": "bun run --parallel --stream --reporter='append-only' format lint",
17-
"validate-skills": "bash -c 'for dir in skills/*/; do uvx --from skills-ref agentskills validate $dir; done'",
18-
"prepare": "simple-git-hooks"
17+
"validate-skills": "bash -c 'for dir in skills/*/; do uvx --from skills-ref agentskills validate $dir; done'"
1918
},
2019
"devDependencies": {
21-
"@j178/prek": "^0.4.10",
2220
"oxfmt": "^0.59.0",
23-
"oxlint": "^1.74.0",
24-
"simple-git-hooks": "^2.13.1"
25-
},
26-
"simple-git-hooks": {
27-
"pre-commit": "bun prek run --all-files --config='.github/.pre-commit.yml' && bun check && bun validate-skills"
28-
},
29-
"trustedDependencies": [
30-
"@j178/prek"
31-
]
21+
"oxlint": "^1.74.0"
22+
}
3223
}

0 commit comments

Comments
 (0)