ワークフローの top-level permissions を明示して default write 権限をやめられるようにする - #34
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SppdKxgYtCGigXC8dZyxob Signed-off-by: krrrr38 <k.kaizu38@gmail.com>
krrrr38
force-pushed
the
explicit-workflow-permissions
branch
from
August 30, 2026 23:32
a84cf3f to
254f766
Compare
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
リポジトリ設定の
default_workflow_permissions: writeをやめられるようにするため、GITHUB_TOKEN の権限をワークフロー側で完結させました。action-lint.yml/labeler.ymlに top-level のpermissions: contents: readを追加(他のワークフローには既に定義済み)permissionsが明示されていたため、job 側の変更はなし現状の権限棚卸し
actionlintchecks: write,contents: read,pull-requests: writeghalintcontents: readgh release downloadchangescontents: read,pull-requests: readall-checkscontents: readbuildcontents: readauto-mergecontents: write,pull-requests: writegh pr merge --autotriagecontents: read,pull-requests: writepackagecontents: writegh release create/delete --cleanup-tagwrite 権限が必要なのは action-lint(reviewdog) / dependabot-auto-merge / labeler / release の 4 job だけで、いずれも明示済みです。
マージ後にやること
Settings → Actions → General → Workflow permissions を Read repository contents and packages permissions に変更する。
同画面の "Allow GitHub Actions to create and approve pull requests" は別設定のため影響なし。
Test plan
ghalint runが exit 0🤖 Generated with Claude Code
https://claude.ai/code/session_01SppdKxgYtCGigXC8dZyxob