Skip to content

fix(workflow): check out PR head branch so fixes push to the PR - #734

Merged
hilram7 merged 1 commit into
devfrom
fix/md-autofix-push-to-pr-branch
Apr 9, 2026
Merged

fix(workflow): check out PR head branch so fixes push to the PR#734
hilram7 merged 1 commit into
devfrom
fix/md-autofix-push-to-pr-branch

Conversation

@hilram7

Copy link
Copy Markdown
Collaborator

Root cause

The workflow checked out the base branch (dev) rather than the PR head branch. As a result, when the autofix script committed and pushed its changes, they went to dev instead of the PR branch — so renamed files never appeared in the PR diff.

The bot comment was posted regardless of push success (the push step uses continue-on-error: true), which is why the workflow appeared to work while the files weren't actually being renamed in the PR.

Fix

  • Changes the checkout ref from pull_request.base.ref to pull_request.head.ref so the bot commits land on the PR branch
  • Removes the "Fetch changed files from PR head" step added in fix(md-autofix): fetch PR files before running script #732 — no longer needed since the PR files are already on disk when checking out the head branch

CodeQL:actions/untrusted-checkout/medium will flag this checkout. Dismissed — PRs are restricted to Netwrix org members with SSO; the untrusted-contributor attack vector does not apply. See alert #80 for full justification.

@hilram7
hilram7 marked this pull request as ready for review April 9, 2026 22:15
@hilram7
hilram7 merged commit 965fdab into devApr 9, 2026
3 checks passed
@hilram7
hilram7 deleted the fix/md-autofix-push-to-pr-branch branch April 9, 2026 22:15
Sign up for freeto 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.

1 participant

@hilram7