CircleCI Ideas

Allow workflow to trigger based on git commit message

It would be useful to be able to trigger a job from a workflow based on a git commit message matching a pre defined regex. This could then be used to deploy code to a test server based on a commit message (i.e. "Some useful commit message #test001" would trigger a deploy to test server test001).

An example yaml may look something like this:

workflows:
  version: 2
test-and-deploy:
jobs:
- test
- deploy:
requires:
- test
filters:
commit:
only:
- ^.*#((test|dev)([0-9]{3}))$


In the above example, the deploy job would only trigger if the commit message contained a match (i.e. #test001).

The commit message (or matched regex) would also need to be made available via an environment variable in order for the job to know which server to deploy to (similar to the way the tag is stored in $CIRCLE_TAG).

  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • Dec 13 2018
  • Not planned
  • Attach files