Skip to content

[Hermes] Remove npm-publish.yml and harden CI workflow security#10

Closed
Coding-Dev-Tools wants to merge 1 commit into
mainfrom
hermes/deploydiff/remove-npm-publish-harden-ci
Closed

[Hermes] Remove npm-publish.yml and harden CI workflow security#10
Coding-Dev-Tools wants to merge 1 commit into
mainfrom
hermes/deploydiff/remove-npm-publish-harden-ci

Conversation

@Coding-Dev-Tools
Copy link
Copy Markdown
Owner

Summary

Remove wrong-language npm-publish.yml and harden all CI workflow security settings.

Why this change

  • npm-publish.yml is wrong for a Python repo: This workflow publishes to npm, but deploydiff is a Python package published to PyPI via publish.yml. The npm workflow is a template artifact that serves no purpose.
  • Missing persist-credentials: false: All checkout steps were persisting GITHUB_TOKEN in .git/config, creating a supply-chain attack vector if a later step is compromised.
  • Missing top-level permissions on ci.yml: Without explicit permissions, the default is write-all, which is excessive for a CI workflow.

What changed

  1. Removed .github/workflows/npm-publish.yml — wrong-language workflow
  2. Added persist-credentials: false to checkout steps in: ci.yml, publish.yml, pages.yml
  3. Added permissions: contents: read to ci.yml (least-privilege)
  4. Updated pages.yml checkout from v4 to v6

Validation performed

  • ruff check src/ → All checks passed
  • pytest tests/ -q → 49 passed
  • Workflow YAML syntax verified

Risks/rollback

  • Low risk: npm-publish.yml was never functional (no package.json exists)
  • persist-credentials: false only blocks git push from checkout, which no workflow needs
  • permissions: contents: read is sufficient for CI test/lint jobs

Follow-ups

  • Same npm-publish.yml removal needed in apighost (last remaining Python repo with this issue)

- Remove npm-publish.yml (wrong-language workflow for Python repo)
- Add persist-credentials: false to all checkout steps (ci, publish, pages)
- Add top-level permissions: contents: read to ci.yml
- Update pages.yml checkout from v4 to v6
@Coding-Dev-Tools
Copy link
Copy Markdown
Owner Author

Closing: This repo has a legitimate npm wrapper (package.json + cli.js). The npm-publish.yml workflow should be kept. See configdrift#9 for rationale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant