diff --git a/README.md b/README.md index 313f073..c28aeb0 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/tasks/collect_info_org.yml b/tasks/collect_info_org.yml index e882d38..5d1797d 100644 --- a/tasks/collect_info_org.yml +++ b/tasks/collect_info_org.yml @@ -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" @@ -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" @@ -40,4 +40,4 @@ runner_service: "actions.runner.{{ github_account[:45] }}.{{ runner_name }}.service" tags: - install - - uninstall \ No newline at end of file + - uninstall diff --git a/tasks/collect_info_repo.yml b/tasks/collect_info_repo.yml index 78dd798..97841bf 100644 --- a/tasks/collect_info_repo.yml +++ b/tasks/collect_info_repo.yml @@ -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" @@ -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" @@ -47,4 +47,4 @@ runner_service: "actions.runner.{{ svc_name[:45] }}.{{ runner_name }}.service" tags: - install - - uninstall \ No newline at end of file + - uninstall