Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
labels:
- dependencies
- security
groups:
next-stack:
patterns:
- next
- react
- react-dom
tooling:
patterns:
- eslint*
- typescript
- @types/*
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

dep_file="$(fd -a '^dependabot\.yml$' .github | head -n1)"
echo "Validating: ${dep_file}"

python - <<'PY' "$dep_file"
import sys, pathlib
p = pathlib.Path(sys.argv[1])
text = p.read_text(encoding="utf-8")
try:
    import yaml
except Exception:
    raise SystemExit("PyYAML missing. Install with: pip install pyyaml")
try:
    yaml.safe_load(text)
    print("YAML parse OK")
except Exception as e:
    print("YAML parse FAILED:")
    print(e)
    raise SystemExit(1)
PY

Repository: peixl/Codex-Getting-Started-Tutorial

Length of output: 323


Quote @-prefixed Dependabot patterns to fix YAML parse failure.

Lines 21 and 26 use unquoted scalars starting with @, which is invalid YAML. The parser fails with "found character '@' that cannot start any token" and prevents Dependabot from loading the config.

Suggested fix
       tooling:
         patterns:
           - eslint*
           - typescript
-          - `@types/`*
+          - "@types/*"
           - tailwindcss
           - postcss
           - autoprefixer
           - wrangler
-          - `@opennextjs/`*
+          - "@opennextjs/*"
🧰 Tools
🪛 YAMLlint (1.38.0)

[error] 21-21: syntax error: found character '@' that cannot start any token

(syntax)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/dependabot.yml at line 21, Dependabot config uses unquoted scalars
starting with @ (e.g., `@types/`*) which breaks YAML parsing; update the list
entries that begin with @ to be quoted (for example change `@types/`* to
"@types/*") so the YAML parser accepts those patterns—locate the entries under
the package update patterns (the array containing `@types/`*) and wrap any
`@-prefixed` strings in quotes.

- tailwindcss
- postcss
- autoprefixer
- wrangler
- @opennextjs/*

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
labels:
- dependencies
- security
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Security

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: '23 4 * * 1'

permissions:
contents: read

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

concurrency:
group: security-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
dependency-review:
name: Dependency review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Dependency review
uses: actions/dependency-review-action@v4
with:
fail-on-severity: high

audit:
name: npm audit
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Install dependencies
run: npm ci

- name: Audit production dependencies
run: npm audit --omit=dev --audit-level=high

secret-scan:
name: Secret scan
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Scan for secrets
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_ENABLE_COMMENTS: false
Comment on lines +78 to +81
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pass GITLEAKS_LICENSE to gitleaks-action

This secret-scan job will fail in organization-owned repositories because gitleaks/gitleaks-action@v2 requires a GITLEAKS_LICENSE environment variable in that context; only GITHUB_TOKEN is currently provided. In org repos this turns the new security workflow red on every run (PR/push/schedule), which can block merges if required checks are enabled.

Useful? React with 👍 / 👎.


codeql:
name: CodeQL
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language:
- javascript-typescript
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: none

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v3
14 changes: 11 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
/.open-next/
/.wrangler/
/.mf/
.dev.vars

# misc
.DS_Store
Expand All @@ -32,9 +31,18 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# local env files
.env*.local
# local env files and secrets
.env
.env.*
!.env.example
!.env*.example
.dev.vars
.dev.vars.*
!.dev.vars.example
.envrc
.direnv/
secrets.json
*.secrets.json

# vercel
.vercel
Expand Down
38 changes: 38 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Security Policy

## Supported Versions

This project currently supports security fixes on the latest state of the `main` branch.

## Reporting a Vulnerability

Please do not open a public issue for security reports, leaked secrets, or deployment credentials.

Instead, use one of these channels:

1. GitHub security advisory reporting for this repository, if available.
2. A private direct contact channel with the maintainer.

When reporting, include:

- a short summary of the issue
- affected files, routes, or workflows
- reproduction steps or proof of concept
- impact assessment
- any suggested remediation

## Secret Handling

- Never commit `.env*`, `.dev.vars*`, `secrets.json`, private keys, or cloud credentials.
- Use GitHub Actions secrets, Cloudflare dashboard secrets, or `wrangler secret put` for production secrets.
- Rotate exposed secrets immediately, then remove them from the repository history if they were ever committed.

## Project Security Baseline

- Branch protection on `main`
- Build validation in CI
- Dependency review on pull requests
- Production dependency audit in CI
- Secret scanning in CI
- CodeQL static analysis
- Dependabot updates for npm and GitHub Actions
39 changes: 5 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"preview": "npm run build && opennextjs-cloudflare preview",
"cf-typegen": "wrangler types"
},
"overrides": {
"postcss": "8.5.14"
},
"dependencies": {
"clsx": "2.1.1",
"next": "^15.5.18",
Expand All @@ -29,7 +32,7 @@
"autoprefixer": "10.4.20",
"eslint": "9.17.0",
"eslint-config-next": "^15.5.18",
"postcss": "8.4.49",
"postcss": "8.5.14",
"tailwindcss": "3.4.17",
"typescript": "5.7.2",
"wrangler": "^4.86.0"
Expand Down
Loading