Run script when creating gitlab commit

I'm using gitlab, I want to get the current commit text on commit in my workflow script. 
My code:

exports.rule = entity.Issue.onChange({
  title: 'vcs-change',
  action: function(ctx) {
     // Run only commit gitlab 

I want this code to run when the user makes a commit and get the current commit text
I thought this code is run when the user makes a commit
exports.rule =  entities.VcsChange = (function(){ 
  // Run when commit even 

but not working

1 comment
Comment actions Permalink

Thank you for contacting YouTrack community forums. To trigger on adding a new commit, you can use something like `return ctx.issue.vcsChanges.added.isNotEmpty();` in the guard section. Each vcsChange object has a `text` property ( that you can access to get the commit message.
Please let me know if it helps.

Please sign in to leave a comment.