Add optional GitHub API authentication headers
If the `GITHUB_TOKEN` is defined in the Ansible controller's environment it is used to set the GitHub REST API authentication header. This is they passed to all `uri` modules tasks which interact with the GitHub REST API. If the `GITHUB_TOKEN` is not set, the authentication header is not used. Fixes #19
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
- name: get latest github release
|
||||
uri:
|
||||
url: https://api.github.com/repos/mikefarah/yq/releases/latest
|
||||
headers: '{{github_auth_headers}}'
|
||||
register: latest
|
||||
|
||||
- set_fact:
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
- name: get latest release
|
||||
uri:
|
||||
url: 'https://api.github.com/repos/mikefarah/yq/releases/latest'
|
||||
headers: '{{github_auth_headers}}'
|
||||
register: latest
|
||||
|
||||
- name: determine if yq needs installed
|
||||
|
||||
Reference in New Issue
Block a user