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 case when pipeline is triggered by non-default branch and has more than one workflow chained, workflows after the first one will checkout the default branch even when triggered by a separate one.
I think we have issue 49 (or similar) returned (#49).
Steps
I have a branch "hotfix" created of main branch
I commit new change to the "hotfix" branch
I have two workflows (chained) to run when there is a change on both main and that second branch (test and build)
When change happens (commit), first workflow works with a proper GITHUB_SHA (or github.sha)
When second workflow starts, it pulls default branch last commit instead <--- ????
I tried to print both GITHUB_SHA and github.sha and both are pointing to the main branch (and not current branch that has triggered the pipeline).
This is a serious issue as if I wasn't using commit Id for application version tag it would deploy completely wrong version of the code to production. I would appreciate any idea or help how to go around this.
Workaround
I was able to avoid it by merging two workflows into one and adding conditionals to the second one (to mimmic on.workflow_run):
Previously the second workflow:
on:
workflow_run:
workflows:
- My Workflow
branches:
- main
- hotfix
types:
- completed
I've been having an issue with the wrong commit being used. I have multiple workflows but not sure that is the issue. When reverting to actions/checkout@v3.5.3 it works as expected again.
We have the same issue using actions/checkout@v3. We are using multiple runners & multiple jobs in 1 pipeline and in some steps the source code is not the one from the triggering commit.
Quick Summary
In case when pipeline is triggered by non-default branch and has more than one workflow chained, workflows after the first one will checkout the default branch even when triggered by a separate one.
I think we have issue 49 (or similar) returned (#49).
Steps
I tried to print both GITHUB_SHA and github.sha and both are pointing to the main branch (and not current branch that has triggered the pipeline).
This is a serious issue as if I wasn't using commit Id for application version tag it would deploy completely wrong version of the code to production. I would appreciate any idea or help how to go around this.
Workaround
I was able to avoid it by merging two workflows into one and adding conditionals to the second one (to mimmic on.workflow_run):
Previously the second workflow:
Added to the second job:
The text was updated successfully, but these errors were encountered: