Skip to content

fix: allow Clippy to push protected workflow files via fallback-to-issue#172

Merged
sergey-tihon merged 2 commits intomasterfrom
copilot/fix-clippy-workflow-issue
Apr 2, 2026
Merged

fix: allow Clippy to push protected workflow files via fallback-to-issue#172
sergey-tihon merged 2 commits intomasterfrom
copilot/fix-clippy-workflow-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

Closes #171

The Clippy workflow was hard-failing when pushing to PR branches that included changes to .github/workflows/clippy.lock.yml or clippy.md — both covered by the .github/ protected path prefix — because push-to-pull-request-branch lacked a protected_files_policy.

Changes

  • clippy.md: Added protected-files: fallback-to-issue to the push-to-pull-request-branch safe-output config, matching the existing behavior on create-pull-request
  • clippy.lock.yml: Propagated "protected_files_policy":"fallback-to-issue" into the push_to_pull_request_branch entry within GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG
safe-outputs:
  push-to-pull-request-branch:
    protected-files: fallback-to-issue  # was missing; caused hard failure

Copilot AI linked an issue Apr 2, 2026 that may be closed by this pull request
…ranch in Clippy workflow

Agent-Logs-Url: https://github.com/sergey-tihon/Clippit/sessions/98d2a173-18cd-4d37-9128-db7d81a56b45

Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix workflow failure in Clippy fix: allow Clippy to push protected workflow files via fallback-to-issue Apr 2, 2026
Copilot AI requested a review from sergey-tihon April 2, 2026 07:27
@sergey-tihon
Copy link
Copy Markdown
Owner

@copilot but it failed to push to https://github.com/sergey-tihon/Clippit/pull/168/changes that does not change workflow definition

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 2, 2026

@copilot but it failed to push to https://github.com/sergey-tihon/Clippit/pull/168/changes that does not change workflow definition

Right — PR #168 itself doesn't touch workflow files, but the 127 KB patch Clippy generated incidentally includes .github/workflows/clippy.lock.yml and .github/workflows/clippy.md. That's because the PR branch diverged from master after the workflow files were updated on master (the "chore: update clippy instructions" commit), so any new patch Clippy generates for that branch picks up those diffs.

The protected-files: fallback-to-issue fix (commit 731124c) addresses exactly this scenario — it's one of the two options the error message explicitly offered. With this in place, when Clippy's patch incidentally includes protected workflow files (whether or not the PR intends to change them), the workflow will create a review issue instead of hard-failing. Without it, the entire Clippy workflow job crashes and nothing gets done.

@sergey-tihon sergey-tihon marked this pull request as ready for review April 2, 2026 09:49
Copilot AI review requested due to automatic review settings April 2, 2026 09:49
@sergey-tihon sergey-tihon merged commit 22593dc into master Apr 2, 2026
22 checks passed
@sergey-tihon sergey-tihon deleted the copilot/fix-clippy-workflow-issue branch April 2, 2026 09:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts Clippy’s safe-output configuration so that when a run attempts to push changes that touch protected paths under .github/ (notably workflow files), it falls back to creating an issue instead of hard-failing—aligning push-to-pull-request-branch behavior with create-pull-request and resolving #171.

Changes:

  • Add protected-files: fallback-to-issue to the push-to-pull-request-branch safe-output config in .github/workflows/clippy.md.
  • Propagate protected_files_policy: "fallback-to-issue" into the push_to_pull_request_branch entry inside GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG in .github/workflows/clippy.lock.yml.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/clippy.md Enables fallback-to-issue for protected file changes when pushing to PR branches.
.github/workflows/clippy.lock.yml Keeps the locked safe-outputs handler config in sync by adding the same protected-files fallback policy for push-to-PR-branch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

[aw] Clippy failed

3 participants