Skip the block in CI/CD pipeline of Semaphore when there is changes only in docs directory (Semaphore)

Viewed 24

At the moment, we go through the full CI/CD process for changes to documentation ( eg in the project /docs folder).

This makes it a bit more difficult for people to make changes to docs, as each change triggers CI/CD workflows, redeploys the latest version of the app to staging/production etc - all of which is unnecessary.

I want to amend the semaphore.yml so that none of our CI/CD steps runs when the only changes in a commit are in the /docs directory.

I tried the solution mentioned here ( CI/CD) but it doesn' work.

blocks:
  - name: Linting
    dependencies: []
    run:
      when: "change_in('/', {exclude: ['/docs']})"
    task:
      agent:
        machine:
          type: e1-standard
          os_image: ubuntu
        containers:

0 Answers
Related