Getting the last commit message into the run command #27193
-
In my Java project, there is a properties file that is used by a plugin to populate a box on an output HTML file (making the result of my Selenium test look nice). I just wanted to take the text of the last commit to the subject repo and use sed to hack the relevant property in the file. I have been able to make a similar hack using a static string, but using dynamically generated data (e.g. `git log -1 --pretty=format::"%s"’) leaves me cold. I nearly got there with set-env, but that is deprecated. Can anyone please tell me how this can be done? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
KoalaTeaSoftware:
It has been replaced by the
Or if you need the output only for the
|
Beta Was this translation helpful? Give feedback.
-
Excellent! Thanks for this, I now can achieve what I was trying to do. I have now realised that what was doing was, actually, not going to achieve what I actually wanted doing, but that is The Human Condition. |
Beta Was this translation helpful? Give feedback.
It has been replaced by the
GITHUB_ENV
environment file. The other thing you need to know is that in Bash you can use$(command)
to substitute the output ofcommand
. So to set aCOMMIT_MSG
environment variable for use in later steps:Or if you need the output only for the
sed
command you could skip the variable and just do something like: