Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ It supports Enterprise, Organization and Repository Runners.

* The role requires a Personal Access Token to access GitHub. The token can be set as the `PERSONAL_ACCESS_TOKEN` environment variable.

> **Note**
> **Note**
> The token must have the `repo` scope (when creating a repo runner), the `admin:org` scope (when creating a runner for an organization),
> or the `manage_runners:enterprise` scope (when creating an enterprise runner).
> Personal Access Token for GitHub account can be created [here](https://github.com/settings/tokens).

> **Warning**
> **Warning**
> Never store your personal access token in the GitHub repository. Use [GitHub Secrets](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) or a different secrets service.

* Runner user has to be pre-created.
Expand Down Expand Up @@ -87,6 +87,9 @@ github_api_runners_per_page: 100
# Personal Access Token for your GitHub account
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"

# Public github Access Token for the actions-runner release download
public_gh_access_token: "{{ lookup('env', 'PUBLIC_GH_ACCESS_TOKEN') }}"

# Is it the runner for organization or not?
runner_org: false

Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ github_api_runners_per_page: 100
# Personal Access Token for your GitHub account
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"

# Public github Access Token for the actions-runner release download
public_gh_access_token: "{{ lookup('env', 'PUBLIC_GH_ACCESS_TOKEN') }}"

# Is it the runner for organization or not?
runner_org: false

Expand Down
2 changes: 1 addition & 1 deletion tasks/collect_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
ansible.builtin.uri:
url: "https://api.github.com/repos/{{ runner_download_repository }}/releases/latest"
headers:
Authorization: "token {{ access_token }}"
Authorization: "token {{ public_gh_access_token | default(access_token) }}"
Content-Type: "application/json"
method: GET
return_content: true
Expand Down