Skip to content

Commit b14a9be

Browse files
flavorjonesclaude
andauthored
ci: harden GitHub Actions workflows (#146)
* Add zizmor and actionlint CI job for GitHub Actions auditing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Configure dependabot for github-actions and bundler with cooldowns Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Pin GitHub Actions to SHA hashes with pinact Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Suppress unpinned-images for service containers Digest pinning for service container images is nontrivial and low value for CI test databases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix artipacked and excessive-permissions findings Add persist-credentials: false to test job checkout. Set workflow-level permissions to deny-all and add scoped contents: read to each job. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Pin sqlite3 to ~> 1.4 for Rails 6.x compatibility Rails 6.0/6.1 requires sqlite3 ~> 1.4, but without a constraint in the gemspec, bundler resolves sqlite3 2.x on Ruby 3.0+ which is incompatible. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 226f932 commit b14a9be

File tree

3 files changed

+53
-5
lines changed

3 files changed

+53
-5
lines changed

.github/dependabot.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: github-actions
5+
directory: "/"
6+
groups:
7+
github-actions:
8+
patterns:
9+
- "*"
10+
schedule:
11+
interval: weekly
12+
cooldown:
13+
default-days: 7
14+
15+
- package-ecosystem: bundler
16+
directory: "/"
17+
schedule:
18+
interval: weekly
19+
cooldown:
20+
semver-major-days: 7
21+
semver-minor-days: 3
22+
semver-patch-days: 2
23+
default-days: 7

.github/workflows/ci.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,32 @@ name: CI
22

33
on: [push, pull_request]
44

5+
permissions: {}
6+
57
jobs:
8+
lint-actions:
9+
name: GitHub Actions audit
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
14+
steps:
15+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
with:
17+
persist-credentials: false
18+
19+
- name: Run actionlint
20+
uses: rhysd/actionlint@393031adb9afb225ee52ae2ccd7a5af5525e03e8 # v1.7.11
21+
22+
- name: Run zizmor
23+
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2
24+
with:
25+
advanced-security: false
26+
627
test:
728
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
831

932
strategy:
1033
fail-fast: false
@@ -19,13 +42,13 @@ jobs:
1942

2043
services:
2144
mysql:
22-
image: mysql
45+
image: mysql # zizmor: ignore[unpinned-images] -- version tag is fine for service containers
2346
env:
2447
MYSQL_ALLOW_EMPTY_PASSWORD: yes
2548
ports:
2649
- 3306:3306
2750
postgres:
28-
image: postgres
51+
image: postgres # zizmor: ignore[unpinned-images] -- version tag is fine for service containers
2952
env:
3053
POSTGRES_PASSWORD: password
3154
POSTGRES_HOST_AUTH_METHOD: trust
@@ -39,9 +62,11 @@ jobs:
3962
DB_HOST: 127.0.0.1
4063

4164
steps:
42-
- uses: actions/checkout@v3
65+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
66+
with:
67+
persist-credentials: false
4368

44-
- uses: ruby/setup-ruby@v1
69+
- uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0
4570
with:
4671
ruby-version: ${{ matrix.ruby-version }}
4772
bundler-cache: true

marginalia.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
1616
gem.add_development_dependency "rake"
1717
gem.add_development_dependency "mysql2"
1818
gem.add_development_dependency "pg"
19-
gem.add_development_dependency "sqlite3"
19+
gem.add_development_dependency "sqlite3", "~> 1.4"
2020
gem.add_development_dependency "minitest"
2121
gem.add_development_dependency "mocha"
2222
gem.add_development_dependency "sidekiq"

0 commit comments

Comments
 (0)