CI audit is non-blocking and nothing gates a release on known advisories

Aberta Para iniciantes
#460 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
78/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
github-actions, typescript
Domínio
ci-cd, devops

Direção de pesquisa

Leia .github/workflows/ci.yml por volta das linhas 111–115 e depois compare os jobs de bundle e build em .github/workflows/release.yml e .github/workflows/publish.yml. Adicione aos caminhos de release a auditoria bloqueante das dependências de produção, conforme descrito na issue, mantendo as auditorias de PR como informativas. Verifique a alteração do workflow com uma execução que mostre o novo comportamento; a issue também lista npm run build && npm test e os comandos de typecheck e lint.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

ci effort: small priority: medium

Summary

CI audit is non-blocking and nothing gates a release on known advisories. The reasoning for PRs is sound, but the same leniency applies to the release path, where the .mcpb freezes the lockfile's production tree into an artifact users install. A critical advisory in shipped dependencies is currently visible only to someone who opens a green job's log. The project works directly on main with no PR review step, so nobody is prompted to look.

Where

  • .github/workflows/ci.yml:111
  • .github/workflows/ci.yml:114
  • .github/workflows/publish.yml:26
  • .github/workflows/release.yml:126
  • scripts/build-mcpb.mjs:41

Details

The only audit step is

# Report advisories in shipped (non-dev) dependencies without blocking
# the build; a new upstream advisory should not fail an unrelated PR.
- name: npm audit (production deps)
  continue-on-error: true
  run: npm audit --omit=dev --audit-level=high

(ci.yml:111-115). It fails today (a cross-spawn advisory with a fix available) and the job stays green. publish.yml (build job: npm ci, build, test, pack, lines 26-34) and release.yml (bundle job: npm ci, build, build-mcpb.mjs, lines 124-128) run no audit at all, and build-mcpb.mjs:41 passes --no-audit to the npm ci that fills the bundle's node_modules.

Impact

The reasoning for PRs is sound, but the same leniency applies to the release path, where the .mcpb freezes the lockfile's production tree into an artifact users install. A critical advisory in shipped dependencies is currently visible only to someone who opens a green job's log. The project works directly on main with no PR review step, so nobody is prompted to look.

How to see it

Open any recent CI run: the "npm audit (production deps)" step shows a failure annotation while the job passes; release 0.60.0's bundle was built from the same lockfile.

Suggested fix

Keep the PR step advisory, and add a blocking npm audit --omit=dev --audit-level=high to the release bundle job (release.yml, before build-mcpb.mjs) and to publish.yml's build job, or make the CI step blocking on push to main only (continue-on-error: ${{ github.event_name == 'pull_request' }}).

Acceptance criteria

  • The workflow change is in place and a run shows the new behavior

Getting started

  • Relevant files: .github/workflows/ci.yml, .github/workflows/publish.yml, .github/workflows/release.yml, scripts/build-mcpb.mjs
  • How to run tests: npm run build && npm test (also npm run typecheck and npm run lint)
  • Related docs: CONTRIBUTING.md, AGENTS.md

Filed by repo-audit/full-audit at b8156ef. Severity: medium. Effort: S. audit-key: ci|.github/workflows/ci.yml|npm-audit-continue-on-error

Linguagem predominante
TypeScript
Estrelas
1
Forks
4
Merge médio
3d 4h
PRs com merge (30d)
4

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/screencast-mcp

Todas as issues de TMHSDigital/screencast-mcp

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.