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

Idea: More context data (e.g. Commit Message, Commit Range)

Solved! Go to Solution.

It would be nice if gh-actions adds more context data.

 

My Wishlists are:

 

  • Commit Message: This can be useful for conditional builds
  • Commit Range: This can be useful for linting commit message (e.g. CommitLint)

 

Also there is a CI Environment Variable comparision matrix between CI providers:

https://github.com/pvdlg/env-ci#supported-ci

 

 

3 Replies
GitHub Staff
Message 2 of 4

Re: Idea: More context data (e.g. Commit Message, Commit Range)

GitHub Actions provides a very rich set of context data includeing the full event payload for the webhook that triggered the run.  For more information about how to access the context see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions

Copilot Lvl 2
Message 3 of 4

Re: Idea: More context data (e.g. Commit Message, Commit Range)

Is there a way of accessing the commit message from the event payload? I can't find any information in the linked documentation

Solution
Copilot Lvl 2
Message 4 of 4

Re: Idea: More context data (e.g. Commit Message, Commit Range)

Answering my own question, you can access a commit message like this from a push event, where the commit array is all the commits included in a push:

 

${{github.event.commits[0].message}}

Found in the documentation here