Skip to content

Restrict release workflow token permissions - #37

Merged
konard merged 3 commits into
mainfrom
issue-33-42c5c4da9408
Jul 22, 2026
Merged

Restrict release workflow token permissions#37
konard merged 3 commits into
mainfrom
issue-33-42c5c4da9408

Conversation

@konard

@konard konard commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

  • default the release workflow's GITHUB_TOKEN to read-only repository contents
  • preserve explicit contents: write and id-token: write grants only on the automatic and manual publishing jobs
  • add a workflow-policy regression test and a Security changelog fragment

Reproduction

Before this change, the workflow had no top-level permissions declaration:

grep -n '^permissions:' .github/workflows/release.yml
# no output

That caused non-publishing jobs to inherit the repository or organization default token scope.

Verification

  • pytest tests/test_workflows.py -v
  • pytest -v --cov=src --cov-report=term
  • ruff check .
  • ruff format --check .
  • mypy src/
  • python scripts/check_file_size.py

Fixes #33

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #33
@konard konard self-assigned this Jul 22, 2026
@konard konard changed the title [WIP] release.yml has no top-level permissions: block, so jobs inherit the default GITHUB_TOKEN scope Restrict release workflow token permissions Jul 22, 2026
@konard
konard marked this pull request as ready for review July 22, 2026 21:17
@konard

konard commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

Working session summary

Implemented and finalized PR #37.

  • Added top-level contents: read permissions.
  • Retained write/OIDC permissions only for publishing jobs.
  • Added a regression test and Security changelog fragment.
  • Removed the generated PR scaffold marker.
  • Passed all local lint, type, test, coverage, and packaging checks.
  • Final CI passed on SHA 81b90b5.
  • PR is clean, mergeable, and ready for review.

This summary was automatically extracted from the AI working session output.

@konard

konard commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $2.284815

📊 Context and tokens usage:

  • 76.7K / 200K (38%) input tokens, 6.6K / 128K (5%) output tokens

Total: (76.7K + 1.2M cached) input tokens, 6.6K output tokens, $2.284815 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: off (disabled)
  • Model: GPT-5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (1014KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
konard merged commit d9d64b2 into main Jul 22, 2026
7 checks passed
@konard

konard commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

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.

release.yml has no top-level permissions: block, so jobs inherit the default GITHUB_TOKEN scope

1 participant