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

Referecing an element from array in .yml

Solved! Go to Solution.

Hello,

 

I'm trying to get commit message in "on push" workflow.

I assumed I could just get it by using something like

- run: echo ${{ github.event.push.commits.0.message }}

Sadly, I can't, because .0 to get first item from array is invalid syntax.

 

How can I do this?

1 Reply
Solution
Pilot Lvl 2
Message 2 of 2

Re: Referecing an element from array in .yml

- run: echo "${{ github.event.commits[0].message }}"