5

I want to update my yml file to ignore commits from certain users. Is this possible? Is there a similar solution? Ideally I wouldn't even want to trigger the build in the first place.

Pseudo code example of yml file (ignore syntax, I'm just showcasing what I'm trying to do)

user: git show -s --format='%ae' $BITBUCKET_COMMIT
unwantedUser: "person@mail.com"

pipelines:
  tags:
    '**' && user != unwantedUser: # any tags by wanted users
      - step:
          script:
            (...)

What would be the actual syntax to achieve that?

Alejandro Cotilla
  • 2,501
  • 1
  • 20
  • 35

2 Answers2

12

I ended up including the [skip ci] string in my commit messages to avoid triggering the pipeline.

From the documentation:

Can I commit without triggering the pipeline? Yes. If you don't want to run a pipeline on a commit that would normally trigger one, you can include [skip ci] or [ci skip] anywhere in your commit message of the HEAD commit. Any commits that include [skip ci] or [ci skip] in the message are ignored by Pipelines.

Alejandro Cotilla
  • 2,501
  • 1
  • 20
  • 35
3

Alternatively, if you want to trigger pipeline manualy you can use 'custom' tag.

From the documentation

pipelines:
  custom: # Pipelines that can only be triggered manually
    sonar:
      - step:
          script:
            - echo "Manual triggers for Sonar are awesome!"

Custom pipelines do not run automatically on a commit to a branch. You can run a pipeline with commits view page or branches view page.

Community
  • 1
  • 1
Edward D. Wilson
  • 351
  • 1
  • 4
  • 11