CircleCI Ideas

Add ability to filter by commit messages in workflows

Extending https://circleci.com/docs/2.0/workflows/#using-contexts-and-filtering-in-your-workflows to also support enabling or disabling certain workflows by commit messages would be EXTREMELY useful!

  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • Sep 3 2018
  • Taking votes
  • Attach files
  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    December 19, 2018 18:36

    Would also be helpful to filter certain jobs

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    May 03, 2019 18:52

    I agree, it would be a nice feature to have!

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    June 11, 2019 20:16

    Agreed!  Want to ignore test jobs for any commits that contain "hotfix" for instance, but still run our build / deploy pipeline

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    July 18, 2019 18:11

    Vote for this feature along withhttps://ideas.circleci.com/ideas/CCI-I-763, these should be very helpful to control tests like e2e and visual testing conditionally.

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    September 24, 2019 15:37

    Agreed.

    I need to filter-out specific workflows unless my commit message contains some specific substring.

     

    For example:

    ...
    workflows:
    version: 2
    all:
    jobs:
    - build
    - test
    - deploy
    - update_api_docs
    filters:
    commit:
    only: /[update_api_docs]/

    Currently, it is possible to complete this using git tags, but it feels incorrect for me to use such git tags.

     

    And I'm required to do this kind of workaround:

    ...
    - run:
    name: Generate and publish API documentation
    command: |
    last_commit="$(git log -1 --pretty=%B | cat | grep update_api_docs)"

    if [[ ${last_commit} == *[update_api_docs]* ]]
    then
    # Generate and publish API docs
    fi

     

    This is not the way this should work, as it requires all the preparation to be completed (such as "Spin up Environment").