cli
cli copied to clipboard
show commit message and branch when deploying from github actions
It would be really nice to also see the branch name and commit message in the railway dashboard when deploying with github actions.
I'm using the railway cli as described in https://blog.railway.app/p/github-actions, but right now it only seems shows the branch name and commit message for automated deployments with github hooks:

I'm not very familiar with go, but maybe something like this could work:
var branchName = ""
var commitMessage = ""
if os.Getenv("GITHUB_ACTIONS") != "" {
branchName = os.Getenv("GITHUB_REF_NAME")
buffer, err := exec.Command("/bin/sh", "git log -1 --pretty=%B").Output()
if err != nil {
fmt.Println("error:", err)
}
commitMessage = string(buffer)
}
// TODO use the variables and send them to railway dashboard somehow
fmt.Println("branchName:", branchName)
fmt.Println("commitMessage:", commitMessage)
What do you think?