Skip to content

Commit 993324e

Browse files
oschwaldclaude
andcommitted
Add GitHub Actions workflows and Dependabot config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 71dfd3a commit 993324e

File tree

7 files changed

+217
-0
lines changed

7 files changed

+217
-0
lines changed

.github/dependabot.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: daily
7+
time: '14:00'
8+
open-pull-requests-limit: 20
9+
groups:
10+
minor-and-patch:
11+
patterns:
12+
- '*'
13+
update-types:
14+
- minor
15+
- patch
16+
cooldown:
17+
default-days: 7
18+
- package-ecosystem: github-actions
19+
directory: /
20+
schedule:
21+
interval: daily
22+
time: '14:00'
23+
cooldown:
24+
default-days: 7
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Code scanning - action"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
schedule:
9+
- cron: '0 3 * * 6'
10+
11+
jobs:
12+
CodeQL-Build:
13+
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
security-events: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
with:
23+
fetch-depth: 2
24+
persist-credentials: false
25+
26+
- name: Initialize CodeQL
27+
uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
28+
29+
- name: Autobuild
30+
uses: github/codeql-action/autobuild@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
31+
32+
- name: Perform CodeQL Analysis
33+
uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10

.github/workflows/lint.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Precious
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: '3 0 * * SUN'
9+
workflow_dispatch:
10+
permissions:
11+
contents: read
12+
jobs:
13+
precious:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
with:
18+
fetch-depth: 0
19+
persist-credentials: false
20+
- uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
21+
- run: pnpm install --frozen-lockfile
22+
- name: Fetch base ref
23+
if: ${{ github.event.pull_request }}
24+
run: git fetch origin "${BASE_REF}"
25+
env:
26+
BASE_REF: ${{ github.base_ref }}
27+
- name: Select files
28+
id: select-files
29+
run: |
30+
if [[ -n "${PR_NUMBER}" ]]; then
31+
echo "precious-args=--git-diff-from origin/${BASE_REF}" >> "$GITHUB_OUTPUT"
32+
else
33+
echo 'precious-args=--all' >> "$GITHUB_OUTPUT"
34+
fi
35+
env:
36+
PR_NUMBER: ${{ github.event.pull_request.number }}
37+
BASE_REF: ${{ github.base_ref }}
38+
- name: Lint files
39+
run: precious lint ${PRECIOUS_ARGS}
40+
env:
41+
PRECIOUS_ARGS: ${{ steps.select-files.outputs.precious-args }}

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
release:
10+
types: [published]
11+
12+
permissions: {}
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
with:
20+
persist-credentials: false
21+
- uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
22+
- run: pnpm install --frozen-lockfile
23+
- run: pnpm test
24+
- run: pnpm run lint
25+
- run: pnpm run build
26+
27+
publish:
28+
needs: build
29+
if: github.event_name == 'release' && github.event.action == 'published'
30+
runs-on: ubuntu-latest
31+
environment: npm
32+
permissions:
33+
contents: write
34+
id-token: write
35+
steps:
36+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37+
with:
38+
persist-credentials: false
39+
- uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
40+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
41+
with:
42+
registry-url: 'https://registry.npmjs.org'
43+
- run: pnpm install --frozen-lockfile
44+
- run: pnpm run build
45+
- run: pnpm publish --provenance --no-git-checks
46+
env:
47+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Run tests
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: '3 2 * * SUN'
9+
permissions: {}
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
version: [18, 20, 22]
16+
steps:
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
with:
19+
persist-credentials: false
20+
- uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
21+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
22+
with:
23+
node-version: ${{ matrix.version }}
24+
- run: pnpm install --frozen-lockfile
25+
- run: pnpm test --coverage
26+
- run: pnpm run build

.github/workflows/zizmor.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: GitHub Actions Security Analysis with zizmor
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
permissions: {}
10+
11+
jobs:
12+
zizmor:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
security-events: write
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
with:
20+
persist-credentials: false
21+
22+
- name: Run zizmor
23+
uses: zizmorcore/zizmor-action@0dce2577a4760a2749d8cfb7a84b7d5585ebcb7d # v0.5.0

.precious.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[commands.eslint]
2+
type = "lint"
3+
cmd = ["pnpm", "exec", "eslint"]
4+
invoke = "once"
5+
include = ["src/**/*.ts"]
6+
ok-exit-codes = 0
7+
8+
[commands.tsc]
9+
type = "lint"
10+
cmd = ["pnpm", "exec", "tsc", "--noEmit"]
11+
invoke = "once"
12+
path-args = "none"
13+
include = ["src/**/*.ts", "tsconfig.json"]
14+
ok-exit-codes = 0
15+
16+
[commands.prettier]
17+
type = "both"
18+
cmd = ["pnpm", "exec", "prettier", "--parser", "typescript"]
19+
lint-flags = ["--check"]
20+
tidy-flags = ["--write"]
21+
path-args = "absolute-file"
22+
include = ["src/**/*.ts"]
23+
ok-exit-codes = 0

0 commit comments

Comments
 (0)