diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0488570..84c1749 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,3 +12,6 @@ updates: directory: / schedule: interval: weekly + groups: + codeql: + patterns: ['github/codeql-action/*'] diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e8c6640..f7ccea7 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -16,8 +16,8 @@ jobs: security-events: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - - uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 + - uses: github/codeql-action/init@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea with: languages: javascript-typescript build-mode: none - - uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 + - uses: github/codeql-action/analyze@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e22fef..5d1bbe1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,6 +18,8 @@ pnpm quality Quality is the complete pre-push gate and never publishes, creates tags/releases, contacts GitHub Packages/SAP/Sandbox, or modifies consumers. Tarball tests use temporary installed ESM consumers, compile declarations and remove temporary directories. Keep every package above 95% statements, branches, functions and lines. Review error, credential, URL and mutation safety branches carefully. +Keep all CodeQL sub-actions pinned to the same commit. The dedicated Dependabot group updates them together; preserve this grouping when editing automation dependencies. + Changes to public exports require compatibility/type tests and selected-package changelog notes. Preserve schema v1 semantics and additive compatibility. If changing the canonical schema JSON, regenerate the embedded schema module and verify parity; document a deliberate compatibility decision before any expansion. Update synthetic fixtures and baseline provenance when consumers advance. Never copy a full Action into a harness. Use synthetic values only: no real secrets, subscriptions, customer names or live SAP calls. Keep generated dist, coverage, tarballs, local auth and IDE files out of commits. Inspect staged files and run `git diff --check` before each commit. Publication is a separate manual owner workflow; no automatic publishing or consumer migration belongs in foundation changes. diff --git a/compatibility/tests/workflows.test.ts b/compatibility/tests/workflows.test.ts index 4077cb7..58e7834 100644 --- a/compatibility/tests/workflows.test.ts +++ b/compatibility/tests/workflows.test.ts @@ -17,6 +17,22 @@ it('CI is read-only and never publishes', () => { expect(Object.keys(ci.on)).toEqual(['pull_request', 'push', 'workflow_dispatch']); expect(JSON.stringify(ci)).not.toMatch(/packages.*write|npm publish/); }); +it('keeps CodeQL steps on one version and groups their Dependabot updates', () => { + const codeqlActions = workflow('codeql') + .jobs.analyze.steps.map((step: { uses?: string }) => step.uses) + .filter( + (action: string | undefined): action is string => + action !== undefined && action.startsWith('github/codeql-action/'), + ); + expect(codeqlActions.length).toBeGreaterThan(1); + expect(new Set(codeqlActions.map((action: string) => action.split('@')[1])).size).toBe(1); + + const dependabot = parse(readFileSync('.github/dependabot.yml', 'utf8')); + const actionsUpdates = dependabot.updates.find( + (update: { 'package-ecosystem': string }) => update['package-ecosystem'] === 'github-actions', + ); + expect(actionsUpdates.groups.codeql.patterns).toEqual(['github/codeql-action/*']); +}); for (const name of ['reserve-package-names', 'publish-package', 'create-package-release']) it(name + ' is manually guarded with least permissions', () => { const w = workflow(name);