diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d3c80ad23..adcbbabf9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,6 +54,21 @@ This document aims to outline the requirements for the various forms of contribu 3) Include a README.md in the subdirectory ## Testing -To run `ansible-lint` you will need to set an environment variable for the token to connect to Automation Hub. You can get a token from [here](https://console.redhat.com/ansible/automation-hub/token). -Copy the value of the token and run `export ANSIBLE_GALAXY_SERVER_AH_TOKEN=` +We utilize pre-commit to handle Git hooks, initiating a pre-commit check with each commit, both locally and on CI. + +To install pre-commit, use the following commands: +```bash +pip install pre-commit +pre-commit install +``` + +For further details, refer to the [pre-commit installation documentation](https://pre-commit.com/#installation). + +To execute ansible-lint (whether within pre-commit or independently), you must configure an environment variable for the token required to connect to Automation Hub. Obtain the token [here](https://console.redhat.com/ansible/automation-hub/token). + +Copy the token value and execute the following command: + +```bash +export ANSIBLE_GALAXY_SERVER_AH_TOKEN= +``` diff --git a/ansible.cfg b/ansible.cfg index 321f02ae1..caef7b00a 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -6,7 +6,9 @@ roles_path=./roles server_list = ah,galaxy [galaxy_server.ah] -#url=https://cloud.redhat.com/api/automation-hub/ +# Grab a token at https://console.redhat.com/ansible/automation-hub/token +# Then define it using ANSIBLE_GALAXY_SERVER_AH_TOKEN="" + url=https://console.redhat.com/api/automation-hub/content/published/ auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token