Skip to content

Restrict GITHUB_TOKEN permissions in the cron Conda workflow - #329

Draft
JarryShaw with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-scanning-alerts-another-one
Draft

Restrict GITHUB_TOKEN permissions in the cron Conda workflow#329
JarryShaw with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-scanning-alerts-another-one

Conversation

Copilot AI commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This updates the Conda maintenance workflow to use explicit least-privilege token permissions. The workflow now defaults to read-only repository access and elevates write access only for the job that commits repository changes.

  • Workflow permission baseline

    • Add a root-level permissions block to /home/runner/work/PyPCAPKit/PyPCAPKit/.github/workflows/cron-conda.yml
    • Set the default GITHUB_TOKEN scope to contents: read
  • Job-scoped write access

    • Add a job-level override for conda-update
    • Grant contents: write only where the workflow creates and pushes repository changes
  • Result

    • Reduces default token scope for the workflow
    • Preserves required write access for the update job without broadening other jobs
permissions:
  contents: read

jobs:
  conda-update:
    permissions:
      contents: write

Co-authored-by: JarryShaw <15666417+JarryShaw@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code scanning alert #6 Restrict GITHUB_TOKEN permissions in the cron Conda workflow Aug 13, 2026
Copilot AI requested a review from JarryShaw August 13, 2026 04:15
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.

2 participants