How to avoid a loop in GitLab CI/CD

298 views Asked by At

I am trying to update the tag of a version.json file in a repo and commit the same file to the repository through GitLab CI. This results in pipeline falling into a loop.

only:
  refs:
    - master
except:
  changes:
      - version.json

If I place the above block in the CI logic, the Pipeline does not pick this stage and if I remove the except block the Pipeline goes on incrementing the tag in version.json.

I am stuck with this since couple of days and any help would be appreciated.

1

There are 1 answers

0
Sergio Tanaka On

You just need to add in your commit message the tag [CI SKIP] - commit message

Gitlab will commit your changes without running a new pipeline