Skip to content

Commit bd09b46

Browse files
committed
docs: Add GitHub Container Registry authentication example
1 parent 577cfb4 commit bd09b46

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Sources/swift-container-plugin/Documentation.docc/authentication.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,20 @@ machine auth.docker.io
3737
login mydockerid
3838
password dckr_pat_B3FwrU...
3939
```
40+
41+
### GitHub Container Registry
42+
43+
> GitHub Container Registry only supports authentication using a [Personal Access Token (classic)](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry).
44+
> A fine-grained personal access token cannot be used.
45+
46+
1. Log into GitHub and [generate a Personal Access Token (classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) for Swift Container Plugin.
47+
48+
2. **Select the *write:packages* scope.**
49+
50+
3. Copy the token and add it, together with your GitHub username, to your `.netrc` file:
51+
52+
```
53+
machine ghcr.io
54+
login mygithubusername
55+
password ghp_fAOsWl...
56+
```

0 commit comments

Comments
 (0)