Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to trigger a specific Github action workflow by commit message value?

Is there any way to trigger a specific Github action workflow by commit-message value? For example, if I push with the commit message "smoke_test", only (one specific workflow ) smoke test workflow should trigger from a set of workflows. Please help, thanks!

like image 556
Naduni Warnakulasooriya Avatar asked Apr 16 '26 04:04

Naduni Warnakulasooriya


1 Answers

Yes, there is. You can inspect trigger event if commit message contains specific keyword.

Here's an example:

name: Smoke tests
on: push

jobs:
 test:
   runs-on: [ ubuntu-latest ]
   steps:
     - name: Run smoke tests
       if: contains(github.event.head_commit.message, 'smoke_test')
       run: |
         echo 'Running smoke tests!'
like image 123
frennky Avatar answered Apr 18 '26 23:04

frennky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!