From 6745e7c3fcf179058b117485acfc130c437a7b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Moen?= Date: Mon, 27 Jan 2025 10:56:16 +0100 Subject: [PATCH] Add documentation about how to use private repositories with the github action (#4491) Co-authored-by: Sorin Sbarnea --- docs/installing.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/installing.md b/docs/installing.md index ec26ccdb66..67a773948e 100644 --- a/docs/installing.md +++ b/docs/installing.md @@ -146,3 +146,22 @@ ansible-lint action you should create a file similar to [dependabot]: https://docs.github.com/en/code-security/dependabot [.github/dependabot.yml]: /~https://github.com/ansible/ansible-lint/blob/main/.github/dependabot.yml#L13-L19 + +### Installing roles and collections from private repositories + +To install roles and collections from private repositories, you can: + +1. Create an [access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens) +1. Add the token as an [deploy secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) +1. Add the following step before the ansible-lint step. + +```yaml +- name: Prepare Git for Github + shell: bash + run: | + git config --global url."https://${{ secrets.ANSIBLE_LINT_TOKEN }}@github.com".insteadOf "https://github.com" + +``` +