mirror of
https://github.com/docker/login-action.git
synced 2024-11-13 23:55:40 +01:00
Merge pull request #59 from crazy-max/ghcr-github-token
Use GITHUB_TOKEN with GHCR
This commit is contained in:
commit
971b76aea9
BIN
.github/ghcr-manage-actions-access.gif
vendored
Normal file
BIN
.github/ghcr-manage-actions-access.gif
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 99 KiB |
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -149,8 +149,8 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.GHCR_USERNAME }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GHCR_PAT }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
gitlab:
|
gitlab:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
19
README.md
19
README.md
@ -89,10 +89,12 @@ jobs:
|
|||||||
|
|
||||||
### GitHub Container Registry
|
### GitHub Container Registry
|
||||||
|
|
||||||
To authenticate against the [GitHub Container Registry](https://docs.github.com/en/packages/getting-started-with-github-container-registry),
|
To use the [GitHub Container Registry](https://docs.github.com/en/packages/getting-started-with-github-container-registry),
|
||||||
you will need to [enable it for your user or organization account](https://docs.github.com/en/packages/guides/enabling-improved-container-support)
|
you need to [enable this feature for your personal or organization account](https://docs.github.com/en/packages/guides/enabling-improved-container-support).
|
||||||
and create a new [personal access token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
|
|
||||||
with the [appropriate scopes](https://docs.github.com/en/packages/getting-started-with-github-container-registry/migrating-to-github-container-registry-for-docker-images#authenticating-with-the-container-registry).
|
To [authenticate against it](https://docs.github.com/en/packages/guides/migrating-to-github-container-registry-for-docker-images#authenticating-with-the-container-registry),
|
||||||
|
use the [`GITHUB_TOKEN`](https://docs.github.com/en/actions/reference/authentication-in-a-workflow) for the best
|
||||||
|
security and experience.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: ci
|
name: ci
|
||||||
@ -111,9 +113,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.CR_PAT }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You may need to manage write and read access of GitHub Actions for repositories in the container settings:
|
||||||
|
|
||||||
|
![Manage Actions access](.github/ghcr-manage-actions-access.gif)
|
||||||
|
|
||||||
|
You can also use a [personal access token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
|
||||||
|
with the [appropriate scopes](https://docs.github.com/en/packages/getting-started-with-github-container-registry/migrating-to-github-container-registry-for-docker-images#authenticating-with-the-container-registry).
|
||||||
|
|
||||||
### GitLab
|
### GitLab
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
Loading…
Reference in New Issue
Block a user