You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Download Terraform modules from private GitHub repositories](#download-terraform-modules-from-private-github-repositories)
55
57
*[Authors](#authors)
56
58
*[License](#license)
57
59
*[Additional information for users from Russia and Belarus](#additional-information-for-users-from-russia-and-belarus)
@@ -241,7 +243,7 @@ pre-commit run -a
241
243
242
244
Or, using Docker ([available tags](https://github.com/antonbabenko/pre-commit-terraform/pkgs/container/pre-commit-terraform/versions)):
243
245
244
-
> **Note**: This command uses your user id and group id for the docker container to use to access the local files. If the files are owned by another user, update the `USERID` environment variable. See [File Permissions section](#docker-usage-file-permissions) for more information.
246
+
> **Note**: This command uses your user id and group id for the docker container to use to access the local files. If the files are owned by another user, update the `USERID` environment variable. See [File Permissions section](#file-permissions) for more information.
245
247
246
248
```bash
247
249
TAG=latest
@@ -845,7 +847,9 @@ If the generated name is incorrect, set them by providing the `module-repo-short
845
847
Check [`tfupdate` usage instructions](https://github.com/minamijoyo/tfupdate#usage) for other available options and usage examples.
846
848
No need to pass `--recursive .` as it is added automatically.
847
849
848
-
## Docker Usage: File Permissions
850
+
## Docker Usage
851
+
852
+
### File Permissions
849
853
850
854
A mismatch between the Docker container's user and the local repository file ownership can cause permission issues in the repository where `pre-commit` is run. The container runs as the `root` user by default, and uses a `tools/entrypoint.sh` script to assume a user ID and group ID if specified by the environment variable `USERID`.
851
855
@@ -865,6 +869,41 @@ $ ls -aldn .
865
869
drwxr-xr-x 9 1000 1000 4096 Sep 1 16:23 .
866
870
```
867
871
872
+
### Download Terraform modules from private GitHub repositories
873
+
874
+
If you use a private Git repository as your Terraform module source, you are required to authenticate to GitHub using a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
875
+
876
+
When running pre-commit on Docker, both locally or on CI, you need to configure the [~/.netrc](https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html) file, which contains login and initialization information used by the auto-login process.
877
+
878
+
This can be achieved by firstly creating the `~/.netrc` file including your `GITHUB_PAT` and `GITHUB_SERVER_HOSTNAME`
0 commit comments