peterjgrainger / action-create-branch

Github action to create a branch
MIT License
92 stars 29 forks source link

Changes Made Through Previous Job Not Applying To Created Branch #388

Open harnerdesigns opened 1 year ago

harnerdesigns commented 1 year ago

Hello,

This might be a bit of a specific issue and maybe I'm just doing something totally wrong.

I'm building a template repo for a client to re-use and have an init action ('fetchLive') that fetches code, modifies that code, and pushes a new commit to the 'main' branch in the repo with the modified code. That all works fine, but then I go to create a couple new branches in a second job ('createBranches') within the same action.

image

The 'action-create-branch' step creates the branches but 1 commit behind 'main', not getting the changes made in the first 'fetchLive' job in the action.

image

I know there's the SHA parameter on the action that I can specify. Do I need to have the first 'change' job pass the commit SHA to the "make-branches" job, or is there any easier way to just say "grab latest commit on 'main' and use that".

I'd appreciate any insight you can provide! Thanks!