Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 3

Wrong branch displayed for workflow

I've noticed that if I merge my `master` branch into another branch (same commit hash), then my workflow will seemingly run on the correct target branch being merged into, but will display the name of the source branch being merged from.

 

As shown in the example below, after merging from `master` to a branch called `deploy-production` my workflow gets triggered. In the workflow I execute `echo ${{github.ref}}`, which clearly shows the correct branch. However, the top-left corner of the page still shows "master", and so does the main "All workflows" list when clicking the "Actions" tab.

 

Screenshot 2019-10-09 15.57.30.png

 

2 Replies
Copilot Lvl 2
Message 2 of 3

Re: Wrong branch displayed for workflow

Yes I have also noticed this. In fact, it is weirder than I thought. Try this:

 

Checkout "master", create and checkout a branch "temp", push "temp". Reset hard "master" to "temp". Reset hard "temp" to some other old commit and push. Now push "master". Even though "temp" now has nothing to do with the commit, the displayed branch for the workflow will be "temp". The actual ref reported in the workflow will be "master", as expected. 

Highlighted
Copilot Lvl 3
Message 3 of 3

Re: Wrong branch displayed for workflow

Yes, this behavior is really weird, as many other CI tools like BitBucket Pipelines, GitLab CI and other are showing the target branch in the running actions list instead of the source branch. 

 

Any news on this?