Commit for status event?

I am experimenting with GitHub Actions and would like to trigger an action when commit status for certain commits (commits for released versions) in a GitHub repo changes.

I have successfully created an action in my repo and it triggers when I add new commit statuses to such commits, but the supplied event payload/metadata always contains the last commit on the default branch.

This is according to documentation, But it is not the information I am interested.

Am I looking in the wrong place? Surely this information must be available somehow?

 Hi  qliklars,

I am not very clear about your scenario. Can you answer my next questions?

_>>_I have successfully created an action in my repo and it triggers when I add new commit statuses to such commits, but the supplied event payload/metadata always contains the last commit on the default branch.

  1. Which trigger event do you use in your workflow?
  2. What’s the meaning of commit status? Status check result of commits?  
  3. How did you add new commit statuses to such commits?
  4. Which commit do you want to use?  

We use a component based development model and implement the functionality for our systems through individual components that are maintained as individual repos in GitHub with releases performed by the component team.
The overall use of the GitHub commit status is to set “additional” status for a commit in addition to statuses that are set by CI tools (Jenkins, Circle CI, …) that are triggered when a commit is pushed to GitHub. The additional statuses reflect API governance (can only be (fully) set when a component, vulnerability scans, BlackDuck (license compliance) scans and they also reflect what we call “intake tests”, tests performed when a new component version is merged into a product (composition).
Using the GitHub commit status allows us to collect all relevant status on the commit and have a single system to verify if a component release is ready for production.
Answers to your questions follow:

  1. Which trigger event do you use in your workflow?
    I use just the  status trigger (https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#status-event-status)
  2. What’s the meaning of commit status? Status check result of commits?
    The meaning is to collect information that can be used to drive automated merges and deployments
    and also initiate reverts if issues for a certain component version is found in production
  3. How did you add new commit statuses to such commits?
    We use the GitHub commit status API to push statuses with a context production-approval[/…]
  4. Which commit do you want to use?
    We would like the status event to work like the deployment_status event (https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#deployment-status-event-deployment_status) and include the “touched” commit in the payload.
    Getting the last commit on the default branch even if you updated a totally different commit does not seem very useful to me

Thank you for your explanation, I have reported your scenario to the appropriate engineering team for further evaluation. I will update here at once when they give any response.   

1 Like