Skip to content

Fix cherry-pick workflow for fork PRs and comment on success#7424

Merged
hanwen-cluster merged 1 commit into
aws:developfrom
hanwen-cluster:testworkflowdevelop
Jun 5, 2026
Merged

Fix cherry-pick workflow for fork PRs and comment on success#7424
hanwen-cluster merged 1 commit into
aws:developfrom
hanwen-cluster:testworkflowdevelop

Conversation

@hanwen-cluster
Copy link
Copy Markdown
Contributor

Description of changes

The cherry-pick workflow failed with "fatal: bad object " when the source PR came from a fork in another account. The job checks out the base repo and only fetches the target branch, so the PR's commits were never present locally and the cherry-pick could not resolve them.

Fetch refs/pull//head before cherry-picking so the PR's original commits are available regardless of which fork they came from.

Also comment on the original PR when a cherry-pick succeeds, linking to the newly opened PR. This mirrors the existing failure comment and gives a clear per-target-branch status when a PR is backported to multiple branches.

References

  • Link to impacted open issues.
  • Link to related PRs in other packages (i.e. cookbook, node).
  • Link to documentation useful to understand the changes.

Checklist

  • Make sure you are pointing to the right branch.
  • If you're creating a patch for a branch other than develop add the branch name as prefix in the PR title (e.g. [release-3.6]).
  • Check all commits' messages are clear, describing what and why vs how.
  • Make sure to have added unit tests or integration tests to cover the new/modified code.
  • Check if documentation is impacted by this change.

Please review the guidelines for contributing and Pull Request Instructions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The cherry-pick workflow failed with "fatal: bad object <sha>" when the
source PR came from a fork in another account. The job checks out the
base repo and only fetches the target branch, so the PR's commits were
never present locally and the cherry-pick could not resolve them.

Fetch refs/pull/<n>/head before cherry-picking so the PR's original
commits are available regardless of which fork they came from.

Also comment on the original PR when a cherry-pick succeeds, linking to
the newly opened PR. This mirrors the existing failure comment and gives
a clear per-target-branch status when a PR is backported to multiple
branches.
@hanwen-cluster hanwen-cluster requested review from a team as code owners June 5, 2026 18:23
@hanwen-cluster hanwen-cluster added the skip-changelog-update Disables the check that enforces changelog updates in PRs label Jun 5, 2026
@hanwen-cluster hanwen-cluster merged commit 25cdadf into aws:develop Jun 5, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog-update Disables the check that enforces changelog updates in PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants