Repository navigation
ci: harden workflows - #287
Merged
Merged
Conversation
RemoteClientTests.cs had a whitespace violation that dotnet format whitespace/style would flag under --verify-no-changes. Fix it so the new CI format-check step (added in the following commit) is green on main. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXhXSh2pae9WnaACYUUe3V Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
- ci.yml: add a workflow-level `permissions: contents: read` block. It builds and tests untrusted pull_request code, so the token should be read-only regardless of org/repo defaults. Add a "Format check" step (dotnet format whitespace/style --verify-no-changes, matching the Makefile's format-check target) between Restore and Build so formatting drift can no longer land on main. - claude.yml: gate every trigger event on the actor's author association (OWNER/MEMBER/COLLABORATOR), in addition to the existing @claude substring checks, so an arbitrary GitHub account can no longer make this write-token job run MSBuild from a PR tree. Keep `contents: write`: anthropics/claude-code-action's GitHub App lists "Contents (Read & Write): For reading repository files and creating branches" as a currently-used permission, and the action's default flow is to commit a fix branch and link a PR-creation URL, which needs write access. - dependabot.yml: add nuget entries for src/LageBuch.App.Android and tests/LageBuch.Acceptance.Tests, which each declare their own Directory.Packages.props and were not previously covered by the root entry. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXhXSh2pae9WnaACYUUe3V Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
This was referenced Sep 10, 2026
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.
Problem
ci.ymlhad nopermissions:block, so the job that builds and tests untrusted pull-request code ran with whatever the org default grants.claude.ymltriggered on any comment, review or issue containing@claude, from any GitHub account, withcontents: writeand unattendeddotnet restore/build/test. A stranger could start a write-token job that runs MSBuild targets from a pull request tree.format-checknever ran in CI, sodotnet formatdrift landed onmainunchallenged.Directory.Packages.propsfiles (Android head, acceptance tests).All third-party actions were already SHA-pinned; those pins are unchanged.
Fix
ci.yml: workflow-levelpermissions: contents: read; a format-check step.claude.yml: every trigger gated onauthor_associationin OWNER/MEMBER/COLLABORATOR; permissions reduced to what the action needs (see the inline comment forcontents).dependabot.yml: NuGet entries for the two nested package directories.Found during a security review of
main; part of a series of review follow-up PRs.🤖 Generated with Claude Code
https://claude.ai/code/session_01PXhXSh2pae9WnaACYUUe3V