最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Github Action run-name no longer prints commit message - Stack Overflow

programmeradmin1浏览0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

The 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 execute git pull, which updates the local copy of origin/main and then performs a merge on their local main which creates a merge commit with the message "Merge branch 'main' of...". The merge commit could have been avoided if the developer had used git 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

发布评论

评论列表(0)

  1. 暂无评论