Skip to content

ci: auto-apply rustfmt and commit formatting fixes#29

Merged
tcrypt25519 merged 4 commits into
masterfrom
ci/auto-rustfmt
Feb 8, 2026
Merged

ci: auto-apply rustfmt and commit formatting fixes#29
tcrypt25519 merged 4 commits into
masterfrom
ci/auto-rustfmt

Conversation

@tcrypt25519

Copy link
Copy Markdown
Owner

Replace the formatting check with cargo fmt --all and use the shared commit-changes composite action to push any fixes back to the branch. Add contents: write permission so the token can push commits.

Replace the formatting check with cargo fmt --all and use the shared
commit-changes composite action to push any fixes back to the branch.
Add contents: write permission so the token can push commits.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 8, 2026 03:58
@semanticdiff-com

semanticdiff-com Bot commented Feb 8, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  .github/workflows/ci.yml  30% smaller

@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the GitHub Actions CI workflow to automatically apply rustfmt fixes and push them back to the branch, instead of failing the build on formatting differences.

Changes:

  • Replace cargo fmt -- --check with cargo fmt --all to auto-apply formatting.
  • Add a step using the shared commit-changes composite action to commit/push formatting updates.
  • Grant contents: write permissions so the workflow token can push commits.

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
tcrypt25519 and others added 3 commits February 7, 2026 22:04
Skip the commit-changes step and downgrade contents permission to
read on fork PRs where GITHUB_TOKEN cannot push.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
GitHub Actions does not support expressions in the permissions block.
Revert to static contents: write — the if: condition on the commit
step is sufficient to prevent pushes on fork PRs.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@tcrypt25519
tcrypt25519 merged commit 7c57f29 into master Feb 8, 2026
1 check passed
@tcrypt25519
tcrypt25519 deleted the ci/auto-rustfmt branch February 10, 2026 12:26
tcrypt25519 added a commit that referenced this pull request Feb 16, 2026
* ci: auto-apply rustfmt and commit formatting fixes

Replace the formatting check with cargo fmt --all and use the shared
commit-changes composite action to push any fixes back to the branch.
Add contents: write permission so the token can push commits.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix

* ci: gate rustfmt commit step to trusted contexts

Skip the commit-changes step and downgrade contents permission to
read on fork PRs where GITHUB_TOKEN cannot push.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* ci: fix permissions expression (must be static)

GitHub Actions does not support expressions in the permissions block.
Revert to static contents: write — the if: condition on the commit
step is sufficient to prevent pushes on fork PRs.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
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