Skip to content
Draft
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
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
time: "04:00"
timezone: "UTC"
open-pull-requests-limit: 10
rebase-strategy: "auto"
groups:
production-dependencies:
dependency-type: "production"
update-types: ["patch", "minor"]
development-dependencies:
dependency-type: "development"
update-types: ["patch", "minor"]
major-updates:
dependency-type: "production"
update-types: ["major"]
major-development-updates:
dependency-type: "development"
update-types: ["major"]
labels:
- "dependencies"
- "dependabot"
commit-message:
prefix: "chore(deps)"
prefix-development: "chore(deps-dev)"
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
pull_request:
push:

permissions:
contents: read
security-events: write

jobs:
ci:
runs-on: ubuntu-latest
Expand All @@ -21,6 +25,20 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Dependency Security Scan
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy results
if: success() || failure()
uses: github/codeql-action/upload-sarif@7fd177fa680c9881b53cdab4d346d32574c9f7f4 # v3
with:
sarif_file: 'trivy-results.sarif'
Comment on lines +28 to +40

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Dependabot Auto-Merge & Self-Heal

on:
pull_request_target:
types: [opened, synchronize, reopened]

Comment on lines +3 to +6
permissions:
contents: write
pull-requests: write
checks: read

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Fetch metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-approve safe updates
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Auto-merge patch & minor
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Flag major updates for review
if: steps.metadata.outputs.update-type == 'version-update:semver-major'
run: gh pr edit "$PR_URL" --add-label "major-update" --add-label "needs-review"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading