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.


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. 

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?