Skip to content

Commit

Permalink
Merge pull request #42 from zakaprov/owner-collect-info
Browse files Browse the repository at this point in the history
Use github_owner variable in collect_info* tasks
  • Loading branch information
MonolithProjects authored Nov 27, 2020
2 parents 94616c5 + e7bee63 commit 37dc70c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ It supports both, Organization and Repository Runners.
* System must have access to the GitHub.

* The role require Personal Access Token to access the GitHub. The token has to be a value of `PERSONAL_ACCESS_TOKEN` variable.
Export the token to the local host environment. The token has to have admin rights for the repo.
Export the token to the local host environment.
> The token must have the `repo` scope (when creating a repo runner) or the `admin:org` scope (when creating a runner for an organization).
Personal Access Token for GitHub account can be created [here](https://github.com/settings/tokens).
**Note:** Never store you 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 some different secrets service.

> :warning: **Never** store you 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 some different secrets service.
* Runner user has to be pre-created.
Recommended role: `monolithprojects.user_management`
Expand Down
6 changes: 3 additions & 3 deletions tasks/collect_info_org.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Get registration token (RUN ONCE)
uri:
url: "https://api.github.com/orgs/{{ github_account }}/actions/runners/registration-token"
url: "https://api.github.com/orgs/{{ github_owner | default(github_account) }}/actions/runners/registration-token"
headers:
Authorization: "token {{ access_token }}"
Accept: "application/vnd.github.v3+json"
Expand All @@ -16,7 +16,7 @@

- name: Check currently registered runners (RUN ONCE)
uri:
url: "https://api.github.com/orgs/{{ github_account }}/actions/runners"
url: "https://api.github.com/orgs/{{ github_owner | default(github_account) }}/actions/runners"
headers:
Authorization: "token {{ access_token }}"
Accept: "application/vnd.github.v3+json"
Expand All @@ -40,4 +40,4 @@
runner_service: "actions.runner.{{ github_account[:45] }}.{{ runner_name }}.service"
tags:
- install
- uninstall
- uninstall
6 changes: 3 additions & 3 deletions tasks/collect_info_repo.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Get registration token (RUN ONCE)
uri:
url: "https://api.github.com/repos/{{ github_account }}/{{ github_repo }}/actions/runners/registration-token"
url: "https://api.github.com/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners/registration-token"
headers:
Authorization: "token {{ access_token }}"
Accept: "application/vnd.github.v3+json"
Expand All @@ -16,7 +16,7 @@

- name: Check currently registered runners (RUN ONCE)
uri:
url: "https://api.github.com/repos/{{ github_account }}/{{ github_repo }}/actions/runners"
url: "https://api.github.com/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners"
headers:
Authorization: "token {{ access_token }}"
Accept: "application/vnd.github.v3+json"
Expand Down Expand Up @@ -47,4 +47,4 @@
runner_service: "actions.runner.{{ svc_name[:45] }}.{{ runner_name }}.service"
tags:
- install
- uninstall
- uninstall

0 comments on commit 37dc70c

Please sign in to comment.