Conversation
Contributor
|
bedrock debug - [puLL-Merge] - brave/pull-merge@401 Diffdiff --git a/.github/workflows/pnpm-audit-fix.yml b/.github/workflows/pnpm-audit-fix.yml
new file mode 100644
index 0000000..58cc0cb
--- /dev/null
+++ .github/workflows/pnpm-audit-fix.yml
@@ -0,0 +1,72 @@
+name: pnpm audit fix
+
+on:
+ schedule:
+ # Run every Monday at 10:00 AM UTC (after model updates at 9:00)
+ - cron: '0 10 * * 1'
+ workflow_dispatch: # Allow manual triggering
+
+permissions:
+ contents: write
+ pull-requests: write
+
+jobs:
+ audit-fix:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
+
+ - name: Setup Node.js
+ uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
+ with:
+ node-version: '24.x'
+ cache: 'pnpm'
+
+ - name: Run pnpm audit fix
+ id: audit-fix
+ continue-on-error: true
+ run: pnpm audit --fix=update
+
+ - name: Check for changes and create PR
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ if git diff --quiet; then
+ echo "No audit fixes needed"
+ exit 0
+ fi
+
+ # Configure git
+ git config user.name "github-actions[bot]"
+ git config user.email "github-actions[bot]@users.noreply.github.com"
+
+ # Create and switch to new branch
+ BRANCH_NAME="automated/pnpm-audit-fix"
+ git checkout -b "${BRANCH_NAME}"
+
+ # Commit changes
+ git add package.json pnpm-lock.yaml
+ if [ -f pnpm-workspace.yaml ]; then git add pnpm-workspace.yaml; fi
+ git commit -m "Fix pnpm audit vulnerabilities"
+
+ # Push branch
+ git push origin "${BRANCH_NAME}" --force
+
+ # Create PR (will fail gracefully if PR already exists)
+ gh pr create \
+ --title "Fix pnpm audit vulnerabilities" \
+ --body "This PR automatically fixes dependency audit vulnerabilities by running \`pnpm audit --fix=update\`.
+
+ ## Changes
+ - Updated \`pnpm-lock.yaml\` with security fixes
+
+ This PR was automatically generated by the \`pnpm-audit-fix\` workflow." \
+ --base main \
+ --head "${BRANCH_NAME}" \
+ --label dependencies \
+ --repo "${GITHUB_REPOSITORY}" || echo "PR already exists or could not be created"
DescriptionAdds a scheduled GitHub Actions workflow that runs Possible Issues
Security Hotspots
ChangesChanges
sequenceDiagram
participant Scheduler as GitHub Scheduler
participant GHA as GitHub Actions Runner
participant Repo as Repository
participant GH as GitHub API (gh cli)
Scheduler->>GHA: Trigger (cron / workflow_dispatch)
GHA->>Repo: checkout
GHA->>GHA: setup pnpm + Node 24
GHA->>GHA: pnpm audit --fix=update
GHA->>GHA: git diff --quiet?
alt changes present
GHA->>Repo: git checkout -b automated/pnpm-audit-fix
GHA->>Repo: git add package.json pnpm-lock.yaml
GHA->>Repo: git commit
GHA->>Repo: git push --force origin automated/pnpm-audit-fix
GHA->>GH: gh pr create (--base main)
GH-->>GHA: PR URL or "already exists"
else no changes
GHA->>GHA: echo "No audit fixes needed" + exit 0
end
|
Contributor
|
anthropic debug - [puLL-Merge] - brave/pull-merge@401 Diffdiff --git a/.github/workflows/pnpm-audit-fix.yml b/.github/workflows/pnpm-audit-fix.yml
new file mode 100644
index 0000000..58cc0cb
--- /dev/null
+++ .github/workflows/pnpm-audit-fix.yml
@@ -0,0 +1,72 @@
+name: pnpm audit fix
+
+on:
+ schedule:
+ # Run every Monday at 10:00 AM UTC (after model updates at 9:00)
+ - cron: '0 10 * * 1'
+ workflow_dispatch: # Allow manual triggering
+
+permissions:
+ contents: write
+ pull-requests: write
+
+jobs:
+ audit-fix:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
+
+ - name: Setup Node.js
+ uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
+ with:
+ node-version: '24.x'
+ cache: 'pnpm'
+
+ - name: Run pnpm audit fix
+ id: audit-fix
+ continue-on-error: true
+ run: pnpm audit --fix=update
+
+ - name: Check for changes and create PR
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ if git diff --quiet; then
+ echo "No audit fixes needed"
+ exit 0
+ fi
+
+ # Configure git
+ git config user.name "github-actions[bot]"
+ git config user.email "github-actions[bot]@users.noreply.github.com"
+
+ # Create and switch to new branch
+ BRANCH_NAME="automated/pnpm-audit-fix"
+ git checkout -b "${BRANCH_NAME}"
+
+ # Commit changes
+ git add package.json pnpm-lock.yaml
+ if [ -f pnpm-workspace.yaml ]; then git add pnpm-workspace.yaml; fi
+ git commit -m "Fix pnpm audit vulnerabilities"
+
+ # Push branch
+ git push origin "${BRANCH_NAME}" --force
+
+ # Create PR (will fail gracefully if PR already exists)
+ gh pr create \
+ --title "Fix pnpm audit vulnerabilities" \
+ --body "This PR automatically fixes dependency audit vulnerabilities by running \`pnpm audit --fix=update\`.
+
+ ## Changes
+ - Updated \`pnpm-lock.yaml\` with security fixes
+
+ This PR was automatically generated by the \`pnpm-audit-fix\` workflow." \
+ --base main \
+ --head "${BRANCH_NAME}" \
+ --label dependencies \
+ --repo "${GITHUB_REPOSITORY}" || echo "PR already exists or could not be created"
DescriptionAdds scheduled GitHub Actions workflow ( Possible Issues
Security Hotspots
ChangesChanges.github/workflows/pnpm-audit-fix.yml
sequenceDiagram
participant Cron as Schedule/Dispatch
participant Job as audit-fix job
participant PNPM as pnpm audit
participant Git as Repo
participant GH as GitHub API (gh)
Cron->>Job: trigger (Mon 10:00 UTC)
Job->>Git: checkout main
Job->>PNPM: pnpm audit --fix=update
PNPM-->>Job: modified package.json (errors swallowed)
Job->>Job: git diff --quiet?
alt no changes
Job-->>Cron: exit 0
else changes
Job->>Git: checkout -b automated/pnpm-audit-fix
Job->>Git: commit package.json, pnpm-lock.yaml
Job->>Git: push --force
Job->>GH: gh pr create --base main --label dependencies
GH-->>Job: PR created or error (ignored)
end
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recreates the weekly dependency-audit-fix automation that was lost in the pnpm migration (7f03ed8 removed
.github/workflows/npm-audit-fix.yml), which left #388 stale.Changes
.github/workflows/pnpm-audit-fix.yml: scheduled cron0 10 * * 1+ manual dispatchpnpm audit --fix=update(updatespnpm-lock.yamlwith security fixes) and opens a PR when the lockfile changesautomated/pnpm-audit-fix, PR labeleddependenciesVerified:
pnpm audit --fix=updatevalid with pnpm 11.22.0 (exit 0,0 vulnerabilities were fixed);actionlintclean on the new workflow.Closes #388