I have a Github action that runs on push to branch 'main'. By default, this action has always shown my commit message as the run-name. According to github's documentation, that is the expected behavior. Recently, the run-name changed to always just show "Merge branch 'main' of /..." every time. I attempted to override this by adding to the top of the workflow file:
run-name: ${{ github.event.head_commit.message }}
This did not effect the run-name.
The only change I made prior to this problem was to my cloud service account roles to allow the rest of workflow to run without errors due to a recent change in cloud services.
I have a Github action that runs on push to branch 'main'. By default, this action has always shown my commit message as the run-name. According to github's documentation, that is the expected behavior. Recently, the run-name changed to always just show "Merge branch 'main' of https://github/..." every time. I attempted to override this by adding to the top of the workflow file:
run-name: ${{ github.event.head_commit.message }}
This did not effect the run-name.
The only change I made prior to this problem was to my cloud service account roles to allow the rest of workflow to run without errors due to a recent change in cloud services.
Share Improve this question asked Mar 15 at 11:37 Matthew MichaudMatthew Michaud 1452 silver badges11 bronze badges1 Answer
Reset to default 0The message "Merge branch 'main' of..." is likely the commit message. This is the default message in git that appears when you have a non-linear git commit history.
An example of a non-linear history:
- Developer 1 checks out main, makes some changes and commits them to their local working copy but does not push them to origin.
- Developer 2 checks out main, makes some changes, commits them to their local working copy and then pushes the back to origin
- Developer 1 decides to push their changes to origin but when they use
git push
they receive an error that their local copy is not current (they do not have Developer 2's changes yet). They executegit pull
, which updates the local copy oforigin/main
and then performs a merge on their localmain
which creates a merge commit with the message "Merge branch 'main' of...". The merge commit could have been avoided if the developer had usedgit pull --rebase
which would have placed their changes at the HEAD of the branch and preserved a linear history.
Few options:
set up a branch rule for your
main
branch and enable the Require linear history option.if you're using Pull Requests, in the Settings -> General disable the Allow merge commits option