[Hermes] Harden CI workflow security and add .gitattributes#13
Merged
Coding-Dev-Tools merged 1 commit intoMay 19, 2026
Merged
Conversation
- Add .gitattributes for consistent LF line endings across platforms - Add persist-credentials: false to pages.yml checkout step - Add permissions: contents: read to publish.yml - Add persist-credentials: false to publish.yml checkout step Prevents credential exfiltration from non-push workflows and stops cross-platform line-ending corruption.
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
Harden CI workflow security and add .gitattributes for consistent line endings.
Why this change
actions/checkoutpersists the GitHub token in.git/configby default, allowing any later step to exfiltrate it. Non-push workflows should usepersist-credentials: false.publish.ymlhad no top-levelpermissions:block, granting overly broad default permissions..gitattributesfile existed, risking cross-platform line-ending corruption (CRLF/LF mismatches).What changed
.gitattributes: Added with* text=auto eol=lffor consistent line endingspublish.yml: Addedpermissions: contents: readandpersist-credentials: falseon checkoutpages.yml: Addedpersist-credentials: falseon checkoutValidation
pytest tests/ -v)ruff check src/ tests/)Risks
persist-credentials: falseonly affects token storage in.git/config, not the checkout itself. Publish workflow still usesTWINE_PASSWORDfrom secrets for PyPI upload. Pages workflow still haspages: writeandid-token: writepermissions for deployment.Follow-ups
dependabot.ymlupdates forgitleaksor other security scanning (already has pip + actions dependabot)