title: GitLab CI - avoid build when adding tag
body: <p>How do I prevent a gitlab ci pipeline being triggered when I add a git tag? I'm running this command locally (as opposed to within a gitlab-ci job) </p>
  
  <pre><code>git tag -a "xyz"
  </code></pre>
  
  <p>and then pushing the tag; and this triggers various pipelines. I want to exclude some of those pipelines from running. </p>
  
  <p>I'm trying variations on ideas from questions such as <a href="https://stackoverflow.com/questions/49514416/trigger-gitlab-ci-pipeline-only-when-there-is-a-new-tag">this</a>; that question is using <strong>only</strong>, I'm wanting to exclude, so I'm trying except. The answers there have two variants, one with <strong>refs</strong> one without.</p>
  
  <pre><code>build:  
    # ... my work here ...  
    except:
      - tags
  
  
  build:  
    # ... my work here ...  
    except:
      refs:
        - tags
  </code></pre>
  
  <p>Neither seem to have any effect; I add a tag, the build still happens.</p>
  
  <p>My understanding may be completely awry here as there seem to be three possible meanings of the word <strong>tags</strong> and when reading docs or examples I'm not always sure which meaning is applicable:</p>
  
  <ol>
  <li>Git tags applied using <strong>git tag</strong></li>
  <li>Gitlab CI tags used to determine which runners pick a job</li>
  <li>The <strong>ref</strong> identifier of a commit used to trigger a pipeline via the REST API. This is usually a branch name, but could be a git tag.</li>
  </ol>
  
  <p>I'm interested in controlling what happens if the first case. It does seem clear from comments so far that "except: -tags" is not relevant to my case, so is there any approach that does work?</p>