Skip to content

Commit

Permalink
Merge pull request #221 from JoeNyland/protected
Browse files Browse the repository at this point in the history
Allow the runner to be registered as protected
  • Loading branch information
riemers authored Feb 21, 2022
2 parents 34db359 + 5685061 commit 863f665
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ gitlab_runner_runners:
tags: []
# Indicates whether this runner can pick jobs without tags.
run_untagged: true
# Indicates whether this runner should only pick jobs from protected branches.
protected: false
# Docker privileged mode
docker_privileged: false
# Runner Locked. When a runner is locked, it cannot be assigned to other projects
Expand Down
3 changes: 3 additions & 0 deletions tasks/register-runner-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
{% if gitlab_runner.run_untagged|default(true) %}
--run-untagged
{% endif %}
{% if gitlab_runner.protected|default(false) %}
--access-level="ref_protected"
{% endif %}
--executor '{{ gitlab_runner.executor|default("shell") }}'
--limit '{{ gitlab_runner.concurrent_specific|default(0) }}'
--output-limit '{{ gitlab_runner.output_limit|default(4096) }}'
Expand Down
3 changes: 3 additions & 0 deletions tasks/register-runner-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
{% if gitlab_runner.run_untagged|default(true) %}
--run-untagged
{% endif %}
{% if gitlab_runner.protected|default(false) %}
--access-level="ref_protected"
{% endif %}
--executor '{{ gitlab_runner.executor|default("shell") }}'
{% if gitlab_runner.shell is defined %}
--shell '{{ gitlab_runner.shell }}'
Expand Down
3 changes: 3 additions & 0 deletions tasks/register-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
{% if gitlab_runner.run_untagged|default(true) %}
--run-untagged
{% endif %}
{% if gitlab_runner.protected|default(false) %}
--access-level="ref_protected"
{% endif %}
--executor '{{ gitlab_runner.executor|default("shell") }}'
{% if gitlab_runner.shell is defined %}
--shell '{{ gitlab_runner.shell }}'
Expand Down

0 comments on commit 863f665

Please sign in to comment.