Skip to content

Commit

Permalink
Add documentation about how to use private repositories with the gith…
Browse files Browse the repository at this point in the history
…ub action (#4491)

Co-authored-by: Sorin Sbarnea <ssbarnea@redhat.com>
  • Loading branch information
umglurf and ssbarnea authored Jan 27, 2025
1 parent e885de5 commit 6745e7c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<!-- {% raw %} -->
```yaml
- name: Prepare Git for Github
shell: bash
run: |
git config --global url."https://${{ secrets.ANSIBLE_LINT_TOKEN }}@github.com".insteadOf "https://github.com"
```
<!--
# spell-checker:ignore endraw
{% endraw %} -->

0 comments on commit 6745e7c

Please sign in to comment.