Skip to content

Commit 37cc643

Browse files
authored
ci: zizmor (#758)
* ci: zizmor * docs: improve workflow-templates * docs: README point to templates as examples * ci: dependabot schedule changes * chore: devcontainer extension updates * feat: devcontainer version everything * ci: dependabot update docker image * fix: dependabot * ci: zizmor enable annotations * ci: disable
1 parent c7aa728 commit 37cc643

7 files changed

Lines changed: 88 additions & 72 deletions

File tree

.devcontainer/devcontainer-lock.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
{
22
"features": {
3-
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {
3+
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0.5": {
44
"version": "1.0.5",
55
"resolved": "ghcr.io/anthropics/devcontainer-features/claude-code@sha256:cfc2e7d3e9fd3b9b01f8d5cb158508a884c8c0ede2e23ed10f32dea5d4ffe69a",
66
"integrity": "sha256:cfc2e7d3e9fd3b9b01f8d5cb158508a884c8c0ede2e23ed10f32dea5d4ffe69a"
77
},
8-
"ghcr.io/devcontainers-extra/features/act:1": {
8+
"ghcr.io/devcontainers-extra/features/act:1.0.15": {
99
"version": "1.0.15",
1010
"resolved": "ghcr.io/devcontainers-extra/features/act@sha256:db4a2194930d1f7ec62822d4f600dd2fa4aff3c33b98cdb0b578b64ffb10924c",
1111
"integrity": "sha256:db4a2194930d1f7ec62822d4f600dd2fa4aff3c33b98cdb0b578b64ffb10924c"
1212
},
13-
"ghcr.io/devcontainers-extra/features/pre-commit:2": {
13+
"ghcr.io/devcontainers-extra/features/pre-commit:2.0.18": {
1414
"version": "2.0.18",
1515
"resolved": "ghcr.io/devcontainers-extra/features/pre-commit@sha256:6e0bb2ce80caca1d94f44dab5d0653d88a1c00984e590adb7c6bce012d0ade6e",
1616
"integrity": "sha256:6e0bb2ce80caca1d94f44dab5d0653d88a1c00984e590adb7c6bce012d0ade6e"
1717
},
18-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
19-
"version": "1.9.1",
20-
"resolved": "ghcr.io/devcontainers/features/docker-outside-of-docker@sha256:dc89605f01ff2f24252c61f7c8ba2a58ccdbc14f2ebf87a7952d9e2b89834850",
21-
"integrity": "sha256:dc89605f01ff2f24252c61f7c8ba2a58ccdbc14f2ebf87a7952d9e2b89834850"
18+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1.10.0": {
19+
"version": "1.10.0",
20+
"resolved": "ghcr.io/devcontainers/features/docker-outside-of-docker@sha256:c2c2cf829505ead8e4892c88c31b6594ae94a2bbb209e16e1fac456c1a3a624e",
21+
"integrity": "sha256:c2c2cf829505ead8e4892c88c31b6594ae94a2bbb209e16e1fac456c1a3a624e"
2222
},
23-
"ghcr.io/devcontainers/features/github-cli:1": {
23+
"ghcr.io/devcontainers/features/github-cli:1.1.0": {
2424
"version": "1.1.0",
2525
"resolved": "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671",
2626
"integrity": "sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671"
2727
},
28-
"ghcr.io/devcontainers/features/node:2": {
28+
"ghcr.io/devcontainers/features/node:2.0.0": {
2929
"version": "2.0.0",
3030
"resolved": "ghcr.io/devcontainers/features/node@sha256:fedd4c11f7adfb64283b578dddc7da906728daa25fa293351c9d913231acf12f",
3131
"integrity": "sha256:fedd4c11f7adfb64283b578dddc7da906728daa25fa293351c9d913231acf12f"

.devcontainer/devcontainer.json

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
{
33
"name": "Container - Cloudflare Pages Action",
4-
"image": "mcr.microsoft.com/devcontainers/base:jammy",
4+
// mcr.microsoft.com/devcontainers/base:jammy
5+
"image": "mcr.microsoft.com/devcontainers/base:jammy@sha256:f2d74267998cfe76acefa5cc8d19ccc86bb2ba4520a5ad2b218def9566dc04cd",
56
"customizations": {
67
"vscode": {
78
"extensions": [
8-
"eamodio.gitlens",
9-
"oxc.oxc-vscode",
10-
"github.vscode-github-actions",
11-
"yoavbls.pretty-ts-errors",
12-
"redhat.vscode-yaml",
13-
"GraphQL.vscode-graphql",
14-
"GraphQL.vscode-graphql-syntax",
15-
"vitest.explorer",
16-
"webpro.vscode-knip"
17-
]
9+
"eamodio.gitlens@2026.5.230538",
10+
"github.vscode-github-actions@0.31.5",
11+
"GraphQL.vscode-graphql-syntax@1.3.10",
12+
"GraphQL.vscode-graphql@0.13.4",
13+
"oxc.oxc-vscode@1.56.0",
14+
"redhat.vscode-yaml@1.24.2026052209",
15+
"vitest.explorer@1.50.4",
16+
"webpro.vscode-knip@2.1.5",
17+
"yoavbls.pretty-ts-errors@0.8.7"
18+
],
19+
"settings": {
20+
"extensions.autoUpdate": false,
21+
"extensions.autoCheckUpdates": true
22+
}
1823
}
1924
},
2025
"postCreateCommand": "sed -i '/^ZSH_THEME/c\\ZSH_THEME=\"bira\"' ~/.zshrc && pnpm i && pre-commit install",
2126
"updateContentCommand": "rm -rf .cache && pnpm i && pre-commit install",
2227
"features": {
23-
"ghcr.io/devcontainers-extra/features/act:1": {},
24-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
25-
"ghcr.io/devcontainers/features/node:2": {
28+
"ghcr.io/devcontainers-extra/features/act:1.0.15": {},
29+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1.10.0": {},
30+
"ghcr.io/devcontainers/features/node:2.0.0": {
2631
"version": "24.7.0",
2732
"pnpmVersion": "11.0.8"
2833
},
29-
"ghcr.io/devcontainers/features/github-cli:1": {},
30-
"ghcr.io/devcontainers-extra/features/pre-commit:2": {},
31-
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {}
34+
"ghcr.io/devcontainers/features/github-cli:1.1.0": {},
35+
"ghcr.io/devcontainers-extra/features/pre-commit:2.0.18": {},
36+
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0.5": {}
3237
},
3338
"containerEnv": {
3439
"CLAUDE_CONFIG_DIR": "/home/vscode/.claude"

.github/dependabot.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,27 @@ updates:
66
directory: /
77
schedule:
88
interval: weekly
9-
day: sunday
9+
cooldown:
10+
default-days: 7
11+
- package-ecosystem: docker
12+
directory: /.devcontainer
13+
schedule:
14+
interval: weekly
1015
cooldown:
1116
default-days: 7
1217
- package-ecosystem: 'devcontainers'
1318
directory: '/'
1419
schedule:
1520
interval: weekly
16-
day: sunday
1721
cooldown:
1822
default-days: 7
1923
- package-ecosystem: npm
2024
directory: /
2125
schedule:
2226
interval: weekly
23-
day: sunday
2427
cooldown:
2528
default-days: 7
26-
semver-major-days: 30
29+
semver-major-days: 14
2730
semver-minor-days: 7
2831
semver-patch-days: 3
2932
groups:

.github/workflow-templates/delete.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@ on:
88
- closed
99
branches:
1010
- $default-branch
11+
12+
concurrency:
13+
group: deploy-delete-${{ github.head_ref || github.run_id }}
14+
15+
# Deny all permissions by default; grant only what's needed per job
16+
permissions: {}
17+
1118
jobs:
12-
deploy:
19+
delete:
1320
permissions:
1421
actions: read # Only required for private GitHub Repo
1522
contents: read
@@ -20,6 +27,8 @@ jobs:
2027
steps:
2128
- name: 'Checkout Github Action'
2229
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
30+
with:
31+
persist-credentials: false
2332
- name: 'Deploy deletion from Cloudflare Pages'
2433
uses: andykenward/github-actions-cloudflare-pages/delete@1f45924c4dd0c6d746a7edfaa4e1dea8958806a6 #v3.4.0
2534
with:

.github/workflow-templates/deploy.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
pull_request:
1010
branches:
1111
- $default-branch
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
16+
# Deny all permissions by default; grant only what's needed per job
17+
permissions: {}
18+
1219
jobs:
1320
deploy:
1421
permissions:
@@ -21,6 +28,8 @@ jobs:
2128
steps:
2229
- name: 'Checkout Github Action'
2330
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
31+
with:
32+
persist-credentials: false
2433
- name: 'Deploy to Cloudflare Pages'
2534
uses: andykenward/github-actions-cloudflare-pages@1f45924c4dd0c6d746a7edfaa4e1dea8958806a6 #v3.4.0
2635
with:

.github/workflows/zizmor.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
name: GitHub Actions Security Analysis with zizmor
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: ['**']
9+
10+
# Deny all permissions by default; grant only what's needed per job
11+
permissions: {}
12+
13+
jobs:
14+
zizmor:
15+
name: zizmor
16+
runs-on: ubuntu-latest
17+
permissions:
18+
security-events: write # upload SARIF to GitHub code scanning
19+
contents: read # only needed for private or internal repos
20+
actions: read # only needed for private or internal repos
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
with:
25+
persist-credentials: false
26+
27+
- name: Run zizmor
28+
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6

README.md

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -94,48 +94,10 @@ wrangler:
9494

9595
## Examples
9696

97-
See the GitHub Workflow examples below or [.github/workflow-templates/deploy.yml](.github/workflow-templates/deploy.yml)
97+
See the GitHub Workflow Templates [.github/workflow-templates/](.github/workflow-templates/)
9898

99-
### `push` & `pull_request`
100-
101-
```yaml
102-
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
103-
name: 'Deployment'
104-
on:
105-
push:
106-
branches:
107-
- main
108-
pull_request:
109-
branches:
110-
- main
111-
112-
jobs:
113-
deploy:
114-
permissions:
115-
actions: read # Only required for private GitHub Repo
116-
contents: read
117-
deployments: write
118-
pull-requests: write
119-
runs-on: ubuntu-latest
120-
timeout-minutes: 5
121-
steps:
122-
- uses: actions/checkout@v4
123-
- uses: actions/setup-node@v4
124-
with:
125-
node_version: 20
126-
- run: npm ci
127-
run: npm run build
128-
- name: Deploy to Cloudflare Pages
129-
uses: andykenward/github-actions-cloudflare-pages@1f45924c4dd0c6d746a7edfaa4e1dea8958806a6 #v3.4.0
130-
id: pages
131-
with:
132-
cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
133-
cloudflare-account-id: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
134-
cloudflare-project-name: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
135-
directory: dist
136-
github-token: ${{ secrets.GITHUB_TOKEN }}
137-
github-environment: ${{ vars.CLOUDFLARE_PROJECT_NAME }} ${{ (github.ref == 'refs/heads/main' && '(Production)') || '(Preview)' }}
138-
```
99+
- [.github/workflow-templates/delete.yml](.github/workflow-templates/delete.yml)
100+
- [.github/workflow-templates/deploy.yml](.github/workflow-templates/deploy.yml)
139101

140102
### Fork pull requests with `workflow_run`
141103

0 commit comments

Comments
 (0)