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

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 Likes

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

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

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

9 Likes