Restrict default token permissions in create-release workflow - #328
Conversation
Co-authored-by: JarryShaw <15666417+JarryShaw@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
…ning-alerts-again # Conflicts: # .github/workflows/create-release.yml Co-authored-by: JarryShaw <15666417+JarryShaw@users.noreply.github.com>
Co-authored-by: JarryShaw <15666417+JarryShaw@users.noreply.github.com>
Resolved in |
There was a problem hiding this comment.
🟡 Changes recommended
The PR description claims the change is limited to workflow token permissions, but the PR also includes a public-facing model rename/alias update across code/tests/docs that should be reflected in the PR scope/description (or split).
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR narrows the create-release GitHub Actions workflow’s default GITHUB_TOKEN permissions for the release tagging path, and also standardizes the TCP reassembly hole data model name from HoleDiscriptor to HoleDescriptor while preserving a backwards-compatible alias.
Changes:
- Set
permissions: {}on thetagjob in.github/workflows/create-release.ymlto avoid inheriting defaultGITHUB_TOKENscopes (the job usessecrets.PYPCAPKITfor checkout/push). - Rename the TCP reassembly hole model to
HoleDescriptorand keepHoleDiscriptoras an alias for compatibility. - Update tests and Sphinx docs to reference
HoleDescriptorand validate aliasing.
File summaries
| File | Description |
|---|---|
.github/workflows/create-release.yml |
Removes inherited GITHUB_TOKEN permissions for the tag job via an explicit empty permissions block. |
pcapkit/foundation/reassembly/data/tcp.py |
Renames hole model class to HoleDescriptor and aliases HoleDiscriptor to maintain compatibility; updates type hints/exports. |
pcapkit/foundation/reassembly/tcp.py |
Updates TCP reassembly implementation to use HoleDescriptor. |
pcapkit/foundation/reassembly/data/__init__.py |
Exposes TCP_HoleDescriptor alongside the existing TCP_HoleDiscriptor alias. |
tests/foundation/reassembly/test_tcp.py |
Updates TCP reassembly tests to use HoleDescriptor. |
tests/foundation/reassembly/data/test_models.py |
Updates model alias tests to cover HoleDescriptor and verify the alias relationship. |
docs/source/pcapkit/foundation/reassembly/tcp.rst |
Updates docs to reference HoleDescriptor in autodoc output. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
Co-authored-by: JarryShaw <15666417+JarryShaw@users.noreply.github.com>
Addressed in |
This change addresses the code scanning finding on
create-release.ymlby explicitly denying unusedGITHUB_TOKENpermissions in the release tagging path. The affected job already authenticates withsecrets.PYPCAPKIT, so the workflow now documents and enforces that narrower permission model.Workflow permissions
permissionsblock to thetagjob in.github/workflows/create-release.ymlGITHUB_TOKENscopesRelease tagging path
secrets.PYPCAPKIT