You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our repo we have a dev branch and a prod branch. If a commit is merged (with rebase) directly into prod (i.e. a "hotfix"), I want Github Actions to create a PR from a temporary branch with the new prod commits to dev (i.e. "backfilling hotfix").
Checking the base repository state
/usr/bin/git symbolic-ref HEAD --short
prod
Pull request branch to create or update set to 'test-sync-dev-with-hotfix-20241106-test-hotfix-pr-2'
Create or update the pull request branch
/usr/bin/git symbolic-ref HEAD --short
prod
Working base is branch 'prod'
/usr/bin/git checkout --progress -B c626ceba-2990-4c1f-af60-fb1f8e078f7b HEAD --
Switched to a new branch 'c626ceba-2990-4c1f-af60-fb1f8e078f7b'
/usr/bin/git status --porcelain -unormal --
/usr/bin/git diff --quiet --
/usr/bin/git diff --quiet --staged --
/usr/bin/git stash push --include-untracked
No local changes to save
Resetting working base branch 'prod'
/usr/bin/git checkout --progress prod --
Switched to branch 'prod'
Your branch is up to date with 'origin/prod'.
/usr/bin/git reset --hard origin/prod
HEAD is now at b52347e fix: missing `-m` for invoke
Rebasing commits made to branch 'prod' on to base branch 'dev'
/usr/bin/git -c protocol.version=2 fetch --no-tags --progress --no-recurse-submodules --force --depth=1 origin dev:dev
remote: Total 5 (delta 4), reused 1 (delta 0), pack-reused 0 (from 0)
From https://github.com/x/x
* [new branch] dev -> dev
* [new branch] dev -> origin/dev
*
/usr/bin/git checkout --progress dev --
Switched to branch 'dev'
/usr/bin/git rev-list --reverse prod..c626ceba-2990-4c1f-af60-fb1f8e078f7b .
/usr/bin/git checkout --progress -B c626ceba-2990-4c1f-af60-fb1f8e078f7b HEAD --
Switched to and reset branch 'c626ceba-2990-4c1f-af60-fb1f8e078f7b'
/usr/bin/git -c protocol.version=2 fetch --no-tags --progress --no-recurse-submodules --force --depth=1 origin dev:dev
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
/usr/bin/git rev-list --right-only --count dev...c626ceba-2990-4c1f-af60-fb1f8e078f7b
0
/usr/bin/git -c protocol.version=2 fetch --no-tags --progress --no-recurse-submodules --force --depth=10 origin test-sync-dev-with-hotfix-20241106-test-hotfix-pr-2:refs/remotes/origin/test-sync-dev-with-hotfix-20241106-test-hotfix-pr-2
fatal: couldn't find remote ref test-sync-dev-with-hotfix-20241106-test-hotfix-pr-2
Pull request branch 'test-sync-dev-with-hotfix-20241106-test-hotfix-pr-2' does not exist yet.
/usr/bin/git checkout --progress -B test-sync-dev-with-hotfix-20241106-test-hotfix-pr-2 c626ceba-2990-4c1f-af60-fb1f8e078f7b --
Switched to a new branch 'test-sync-dev-with-hotfix-20241106-test-hotfix-pr-2'
/usr/bin/git rev-list --right-only --count dev...test-sync-dev-with-hotfix-20241106-test-hotfix-pr-2
0
Branch 'test-sync-dev-with-hotfix-20241106-test-hotfix-pr-2' is not ahead of base 'dev' and will not be created
/usr/bin/git rev-parse dev
42c96a3fa270dfe5a20ef10ff29cefcfd7aca5e4
8e27f29531c1f2226fb23f956c18bfb6f9196359
Potentially important callouts:
This workflow is triggered on the PR Closed event, I'm not sure how that impacts git state using the default checkout action
I tried explicitly setting the ref on checkout to prod, same issues
It seems to me that the PR branch (test-sync-dev-with-hotfix-20241106-test-hotfix-pr-2) is actually ahead of dev, based on the commits in the logs above:
Prod is on b52347e (b52347ee221ddd8b9cb5b059dceb62a962f40987)
Dev is on 42c96a3fa270dfe5a20ef10ff29cefcfd7aca5e4
Locally if I run the same command as this action, I get a different result
The commit ID of prod logged by the action (which is the desired content of the PR) b52347ee221ddd8b9cb5b059dceb62a962f40987 does not exist on the prod branch
The same commit has a different SHA when I check the prod branch: 921e1a3afa102e3d96139f59b62a3e9deeda6978
It seems like the lack of diff in the action is caused by Rebasing commits made to branch 'prod' on to base branch 'dev'
Is there a way to disable this rebase step, if it masks the actually commits I want to merge?
One last note:
The action always fails silently. In use-cases like this, failure to create a PR is always an issue. Is it possible to optionally fail the action on failure to create PR?
Steps to reproduce
If this issue is describing a possible bug please provide (or link to) your GitHub Actions workflow.
The text was updated successfully, but these errors were encountered:
The action always fails silently. In use-cases like this, failure to create a PR is always an issue. Is it possible to optionally fail the action on failure to create PR?
Subject of the issue
Hello,
In our repo we have a
dev
branch and aprod
branch. If a commit is merged (with rebase) directly into prod (i.e. a "hotfix"), I want Github Actions to create a PR from a temporary branch with the newprod
commits todev
(i.e. "backfilling hotfix").Here is the configuration I've tried thus far:
Logs:
Potentially important callouts:
This workflow is triggered on the
PR Closed
event, I'm not sure how that impacts git state using the default checkout actionref
on checkout toprod
, same issuesIt seems to me that the PR branch (
test-sync-dev-with-hotfix-20241106-test-hotfix-pr-2
) is actually ahead of dev, based on the commits in the logs above:b52347e
(b52347ee221ddd8b9cb5b059dceb62a962f40987
)42c96a3fa270dfe5a20ef10ff29cefcfd7aca5e4
The commit ID of
prod
logged by the action (which is the desired content of the PR)b52347ee221ddd8b9cb5b059dceb62a962f40987
does not exist on the prod branchprod
branch:921e1a3afa102e3d96139f59b62a3e9deeda6978
It seems like the lack of diff in the action is caused by
Rebasing commits made to branch 'prod' on to base branch 'dev'
One last note:
Steps to reproduce
If this issue is describing a possible bug please provide (or link to) your GitHub Actions workflow.
The text was updated successfully, but these errors were encountered: