chore(security): automate weekly dependency security refresh - #507
Merged
Jayanth Reddy Bujula (jbujula) merged 2 commits intoAug 13, 2026
Merged
Conversation
Dependabot cannot read npm 'overrides', which is where most transitive fixes in this repo live. That gap is why the same S360/Component Governance alerts keep coming back and have to be fixed by hand. Adds: - scripts/audit-overrides.js - resolves each npm audit advisory against the GitHub Advisory DB, compares the real patched version against every installed copy, and only raises an override when a fix is actually published. Refuses flat overrides for packages spanning multiple majors (those silently downgrade other copies). - .github/workflows/dependency-security.yml - weekly job that refreshes the lock, applies the script, and only opens a PR if 'npm run ci' passes. - .github/dependabot.yml - groups routine minor/patch churn so security PRs stay easy to spot; documents the overrides gap. Reviewers come from the existing .github/CODEOWNERS. Nothing auto-merges. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6ac571cd-d84e-4b40-805a-e316a62ed292
CodeQL js/incomplete-sanitization: escaping only the quote character left a trailing backslash able to escape the closing quote. Backslash runs that precede a quote (or end the argument) are now doubled per Windows command-line parsing rules. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6ac571cd-d84e-4b40-805a-e316a62ed292
Jayanth Reddy Bujula (jbujula)
enabled auto-merge (squash)
August 13, 2026 22:06
Brad Flood (brflood)
approved these changes
Aug 13, 2026
Brad Flood (brflood)
approved these changes
Aug 13, 2026
heiwang
approved these changes
Aug 13, 2026
Jayanth Reddy Bujula (jbujula)
deleted the
users/jbujula/automate-dependency-security
branch
August 13, 2026 22:51
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.
Summary
Stops the S360 / Component Governance alerts fixed in #506 from silently coming back.
The gap: Dependabot only reads
dependencies/devDependencies. It cannot see the npmoverridesblock - which is where most transitive fixes in this repo live, including thegulp-mocha > mochaoverride that removes the exact-pinnedminimatch@3.0.4anddiff@5.0.0. So Dependabot reports "no update available" while Component Governance keeps raising the same alerts, and someone has to fix them by hand every time.This matters more here than in most repos: this package ships its own
node_modulesinside the published tarball, so a vulnerable transitive copy left here is re-detected downstream inpowerplatform-build-toolsno matter what that repo pins.Changes
scripts/audit-overrides.jsFor each
npm auditadvisory it walks theviachain to the GHSA IDs, looks each one up in the GitHub Advisory DB for its realfirst_patched_version, then compares that against every installed copy on disk (not just the lockfile). It proposes an override only when a patched version is actually published.Two guard rails learned the hard way:
minimatchat majors 3, 5 and 10 - a flat"minimatch": "^3.1.5"would silently downgradeglob'sminimatch@10.Output is a three-section report: Automatic fixes / Needs a human / Accepted risk.
--writeapplies the automatic ones..github/workflows/dependency-security.ymlWeekly (Mondays 06:00 UTC) plus
workflow_dispatch:npm update- refresh the lock inside the ranges already declared. This alone historically clears most alerts; the ranges were fine, the lock was stale.node scripts/audit-overrides.js --write- raise any range that is genuinely too low.npm run cimust pass - a broken tree is never proposed.Runs on Node 20: the script needs a modern npm for
npm audit --json, and Node 22+ is avoided because its native TypeScript stripping conflicts withts-node/registerduringnpm run ci..github/dependabot.ymlGroups routine minor/patch churn into one PR so genuine security PRs stay easy to spot, adds a
dependencieslabel, and adds agithub-actionsecosystem. Documents the overrides gap.Review and notifications
Nothing auto-merges. Reviewers come from the existing
.github/CODEOWNERS(@microsoft/powerapps-isv-tools-contrib,@microsoft/powerplatform-isv-tools-admin), which already covers*.Verification
Ran against this repo on the #506 branch, where it correctly reported the already-fixed state rather than proposing spurious changes:
It was also validated against
powerplatform-build-toolsin an unfixed state, where it independently reproduced a hand-built fix plan and caught three bugs in it - including the multi-major downgrade above.The same automation is proposed for
powerplatform-build-toolsin microsoft/powerplatform-build-tools#1441.Note
The scheduled trigger only becomes active once this merges into
main- GitHub registersscheduleandworkflow_dispatchfrom the default branch only.