Skip to content

Restrict GITHUB_TOKEN permissions in the cron Conda workflow - #329

Merged
JarryShaw merged 4 commits into
mainfrom
copilot/fix-code-scanning-alerts-another-one
Sep 14, 2026
Merged

JarryShaw merged 4 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
@JarryShaw
JarryShaw marked this pull request as ready for review September 13, 2026 19:53
@JarryShaw

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 2 commits September 13, 2026 19:56
…ning-alerts-another-one

# Conflicts:
#	.github/workflows/cron-conda.yml

Co-authored-by: JarryShaw <15666417+JarryShaw@users.noreply.github.com>
Co-authored-by: JarryShaw <15666417+JarryShaw@users.noreply.github.com>

Copilot AI commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolved in 1dcb140 by merging main into this branch and fixing the conflict in .github/workflows/cron-conda.yml. I also pushed 2ccfa26 to address follow-up automated review feedback.

@JarryShaw
JarryShaw merged commit f977fa9 into main Sep 14, 2026
31 checks passed
@JarryShaw
JarryShaw deleted the copilot/fix-code-scanning-alerts-another-one branch September 14, 2026 02:30
@JarryShaw JarryShaw added ci Pull requests that change CI or workflow configuration (ci: subject prefix) fix Pull requests that fix a defect (fix: subject prefix) labels Sep 22, 2026
@JarryShaw JarryShaw added this to the 1.5 milestone Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Pull requests that change CI or workflow configuration (ci: subject prefix) fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants