I have the following if expression:
jobs: test_pr: if: github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && github.event.comment.body == 'retest')
What it basically does is that the job runs when the event name is pull request or when the issue comment is retest. So that works but the issue is that if i want to trim the github.event.comment.body and i don’t see a way to run a bash command or even use an action in the job.if
I thought about 2 solutions:
This job will be dependent on another job which makes the trimming in the build steps and i will be dependent on this job through the need context. This is nice but now when people look in the jobs tab they will see two jobs and this is confusing.
Add a step to normalize this value and then add the same if to every step which follows. This is not safe because i can forget the if in a new step i make.
The best way would be to run a bash command and use it inside the if but i don’t see it documented in any place. A regular expression command or trim function would also be nice but i don’t see it documented.
Is there another way to fix this?