0

I am using gitlab ci for my CI pipelines , one of the case is to execute a job when a particular file is changed . But when executed manually by run pipeline option it executed that job also. Is this default behavior for manual pipeline or some more rules are required.

Job which should be executed only for file change, but getting executed when triggered manually.

  stage: build
  script:
    - echo "Building web"
  rules:
    - changes: [ FILEBASE/**/* ]

1 Answer 1

0

Per the documentation, when a pipeline it triggered manually rules: changes always evaluates as true:

rules: changes always evaluates to true when there is no Git push event. Tag pipelines, scheduled pipelines, manual pipelines, and so on do not have a Git push event associated with them. A rules: changes job is always added to those pipelines if there is no if that limits the job to branch or merge request pipelines.

So, if you want to exclude this job on manual triggers, you'll need to add an if: condition to your existing rule, or add additional rules.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.