Repository navigation
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
create_pull_request commit shapes via direct-push fallback
|
@copilot ensure that the unsigned commit is allowed. Check the signed-commits field value |
There was a problem hiding this comment.
Pull request overview
Changes pushSignedCommits so that when commit shapes unsupported by GitHub's createCommitOnBranch GraphQL mutation are detected (merge commits, symlinks, submodules), the function now falls back to a direct git push rather than throwing. Adds explicit detection of signed-commit enforcement rejections (GH013) so the resulting error message is actionable when the repository policy blocks the unsigned fallback.
Changes:
- In
push_signed_commits.cjs, replace the hard "refusing unsigned push" error in thePushSignedCommitsUnsupportedShapecatch path with apushBranchAndResolveHeadfallback, and add a newisSignedCommitEnforcementErrorhelper for targeted GH013-style error messages. - Update existing symlink/submodule/merge-commit/deleted-submodule tests to assert the new fallback-push success behavior, and add a new test verifying the signed-enforcement rejection path produces the dedicated error message.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/push_signed_commits.cjs | Routes unsupported-shape catch to direct git push fallback; adds isSignedCommitEnforcementError helper and tailored failure messages when verified-signatures policy blocks the fallback. |
| actions/setup/js/push_signed_commits.test.cjs | Reworks symlink/submodule/merge/deleted-submodule tests to expect fallback-push success and SHA equality with local HEAD; adds a new GH013 rejection scenario; refactors a pre-receive hook string into a template literal. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed in 38c3797. Unsupported commit-shape handling now checks the |
Bug Fix
What was the bug?
create_pull_requestcould not apply “complex” change bundles when the signed GraphQLcreateCommitOnBranchpath encountered unsupported commit shapes (notably merge commits, symlinks, and submodule entries). In the referenced workflow run, this caused PR creation to degrade into fallback issue creation instead of producing the intended PR branch update.How did you fix it?
push_signed_commits.cjs,PushSignedCommitsUnsupportedShapenow triggers an immediate directgit pushfallback attempt instead of hard-failing.push_signed_commits.test.cjsexpectations so merge/symlink/submodule scenarios validate fallback-to-push behavior.Example