# Using git commit message as a condition

**URL:** <https://discuss.circleci.com/t/using-git-commit-message-as-a-condition/45866>\
**Category:** Build Environment\
**Tags:** github, git, ui-test, circle-yml\
**Created:** [October 24, 2022, 3:02pm UTC](https://discuss.circleci.com/t/using-git-commit-message-as-a-condition/45866 "2022-10-24T15:02:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel12599](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@daniel12599](https://discuss.circleci.com/u/daniel12599)\
**Post date:** [October 24, 2022, 3:02pm UTC](https://discuss.circleci.com/t/using-git-commit-message-as-a-condition/45866/1 "2022-10-24T15:02:13Z")

</div>

Hey,  
So I have an expansive test that I don’t want to run on every commit in my circle ci workflow.  
I found that I can use ‘[ci stop]’ in my commit message but it stops the whole workflow. And I want to skip only one step/job (not sure what is what, I’m a confused frontend dev lol).

Here is a mock config.yml for an example to be clear.

```auto

notExpansiveTest:
    <<: *notExpansiveTest
    steps:
      - checkout
      - run:
          name: notExpansiveTest
          command: |
            npm install notExpansiveTest     
           npm run notExpansiveTest

notExpansiveTest:
    <<: *notExpansiveTest
    steps:
      - checkout
      - run:
          name: notExpansiveTest
          command: |
            npm install notExpansiveTest     
           npm run notExpansiveTest

myExpensiveTest:
    environment:
      ExpensiveTest: /tmp/ExpensiveTest-test-results
    docker:
      - image: ExpensiveTest/docker-cli
    
    - when:
        condition: << git.commit.includes(' --runExpensiveTest ') >>
        steps:
          - run: ....
          - run: e.....params.json
          - run: .............

```

So what I want is- the first two steps to run on every commit no matter what is the message.  
And the last (expansive) test to run only when the commit looks like this: “–runExpansiveTest fixed some issue”

Thank you for the help.

---

<div class="post-metadata">

**Author:** ![rit1010](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rit1010/32/34738_2.png) [@rit1010](https://discuss.circleci.com/u/rit1010)\
**Post date:** [October 24, 2022, 5:57pm UTC](https://discuss.circleci.com/t/using-git-commit-message-as-a-condition/45866/2 "2022-10-24T17:57:36Z")

</div>

I’m not sure that the circleci system provides the git commit text as a parameter, so you may need to look at this solution

> **[Getting git commit labels similar to \[skip ci\] as env variables | Cloud...](https://circleci.canny.io/cloud-feature-requests/p/getting-git-commit-labels-similar-to-skip-ci-as-env-variables)**

---

<div class="post-metadata">

**Author:** ![daniel12599](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@daniel12599](https://discuss.circleci.com/u/daniel12599)\
**Post date:** [December 27, 2022, 8:39am UTC](https://discuss.circleci.com/t/using-git-commit-message-as-a-condition/45866/3 "2022-12-27T08:39:39Z")

</div>

Thanks (🙂  
I solved my problem with this: (not commit message but good enough for me)

```auto
- hold: # <<< Stop the workflow to not run an expansive test on each run.
          type: approval 
          requires: # We only run the "hold" job when not-expansive-test has succeeded
           - not-expansive-test
      # On approval of the `hold` job, an expansive test will run.

      - expansive-test:
          requires:
            - hold
            - not-expansive-test

```
