Search code examples
gitlabgitlab-cigitlab-ci-runner

How to set tags on Gitlab runner instances?


The documentation specifies how to set tags on the job side so it only runs on runners equipped with the right tags:

osx job:
  stage: build
  tags:
    - osx
  script:
    - echo "Hello, $USER!"

However, I couldn't find how to set these tags on the runner itself. With the previous example, how can I set "osx" as a tag on my runner?


Solution

  • You can either set this either when registering the runner:

    gitlab-runner register --tag-list "osx,foo,bar" #...
    

    Or you can edit the tags of an already-registered runner using the GitLab UI by clicking the edit icon on the runner list and editing the tag list:

    runner edit