Skip to content

Commit c1132d9

Browse files
Merge pull request #67 from MonolithProjects/develop
Change the way how to set labels
2 parents 06e0222 + 0b7b2e1 commit c1132d9

File tree

8 files changed

+41
-12
lines changed

8 files changed

+41
-12
lines changed
File renamed without changes.

.github/PULL_REQUEST_TEMPLATE.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Pull Request Template
2+
3+
## Description
4+
5+
Please include a summary of the change and which issue is fixed.
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] This change requires a documentation update
15+
16+
## How Has This Been Tested?
17+
18+
Please describe the tests that you ran to verify your changes.
19+
20+
## Destination branch
21+
22+
Create a PR into `develop` branch

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
[![Galaxy Quality](https://img.shields.io/ansible/quality/47375?style=flat&logo=ansible)](https://galaxy.ansible.com/monolithprojects/github_actions_runner)
55
[![Role version](https://img.shields.io/github/v/release/MonolithProjects/ansible-github_actions_runner)](https://galaxy.ansible.com/monolithprojects/github_actions_runner)
66
[![Role downloads](https://img.shields.io/ansible/role/d/47375)](https://galaxy.ansible.com/monolithprojects/github_actions_runner)
7-
[![GitHub Actions](https://github.com/MonolithProjects/ansible-github_actions_runner/workflows/molecule%20test/badge.svg?branch=master)](https://github.com/MonolithProjects/ansible-github_actions_runner/actions)
8-
[![License](https://img.shields.io/github/license/MonolithProjects/ansible-github_actions_runner)](https://github.com/MonolithProjects/ansible-github_actions_runner/blob/master/LICENSE)
7+
[![GitHub Actions](https://github.com/MonolithProjects/ansible-github_actions_runner/workflows/molecule%20test/badge.svg?branch=main)](https://github.com/MonolithProjects/ansible-github_actions_runner/actions)
8+
[![License](https://img.shields.io/github/license/MonolithProjects/ansible-github_actions_runner)](https://github.com/MonolithProjects/ansible-github_actions_runner/blob/main/LICENSE)
99

1010

1111
This role will deploy/redeploy/uninstall and register/unregister local GitHub Actions Runner.
@@ -82,8 +82,8 @@ runner_org: no
8282
# Name to assign to this runner in GitHub (System hostname as default)
8383
runner_name: "{{ ansible_hostname }}"
8484

85-
# Labels to apply to the runner. For examle "'label1','label2'"
86-
runner_labels: "''"
85+
# Labels to apply to the runner
86+
runner_labels: []
8787

8888
# Custom service name when usign Github Enterprise server
8989
# service_name: actions.runner._services.{{ runner_name }}.service
@@ -131,8 +131,8 @@ Same example as above, but runner will be added to an organization.
131131
- role: monolithprojects.github_actions_runner
132132
```
133133
134-
In this example the Ansible role will deploy (or update) the GitHub Actions runner service (version 2.165.2) and register the runner for the GitHub repo. Runner service will run under the user `runner-user`.
135-
The runner service will be *stopped*.
134+
In this example the Ansible role will deploy (or update) the GitHub Actions runner service (version 2.165.2) and register the runner for the GitHub repo. Runner service will run under the user `runner-user`. Runner will be registered with two labels.
135+
The runner service will be *stopped* and disabled.
136136

137137
```yaml
138138
---
@@ -145,6 +145,9 @@ The runner service will be *stopped*.
145145
- github_account: github-access-user
146146
- github_repo: my_awesome_repo
147147
- runner_state: "stopped"
148+
- runner_labels:
149+
- production
150+
- west
148151
roles:
149152
- role: monolithprojects.github_actions_runner
150153
```

defaults/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ runner_org: no
3535
# Name to assign to this runner in GitHub (System hostname as default)
3636
runner_name: "{{ ansible_hostname }}"
3737

38-
# Labels to apply to the runner. For examle "'label1','label2'"
39-
runner_labels: "''"
38+
# Labels to apply to the runner
39+
runner_labels: []
4040

4141
# Custom service name when usign Github Enterprise server
4242
# service_name: actions.runner._services.{{ runner_name }}.service

molecule/default/converge.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
- github_repo: ansible-github_actions_runner-testrepo
1010
- github_account: monolithprojects-testorg
1111
- runner_version: "latest"
12-
- runner_labels: "'test1','test2'"
12+
- runner_labels:
13+
- label1
14+
- repo-runner
1315
roles:
1416
- robertdebock.epel
1517
- ansible-github_actions_runner

molecule/repo/cleanup.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
vars:
77
- runner_user: ansible
88
- github_repo: ansible-github_actions_runner-testrepo
9-
- github_account: monolithprojects
9+
- github_account: monolithprojects-testorg
1010
- runner_state: absent
1111
roles:
1212
- ansible-github_actions_runner

molecule/repo/converge.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
- github_repo: ansible-github_actions_runner-testrepo
1010
- github_account: monolithprojects-testorg
1111
- runner_version: "latest"
12-
- runner_labels: "'test1','repo-runner'"
12+
- runner_labels:
13+
- label1
14+
- repo-runner
1315
roles:
1416
- robertdebock.epel
1517
- ansible-github_actions_runner

tasks/install_runner.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777

7878
- name: Register runner (if new installation) for repo
7979
command: "{{ runner_dir }}/./config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }}/{{ github_repo }} \
80-
--token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels }} --unattended"
80+
--token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended"
8181
args:
8282
chdir: "{{ runner_dir }}"
8383
become: yes

0 commit comments

Comments
 (0)