我正在尝试通过从 GitHub Actions 中的 GHCR 拉取来设置测试。根据文档,应使用GITHUB_TOKEN
. 所以我有以下设置:
name: CI
on: push
env:
REGISTRY: ghcr.io
jobs:
test:
runs-on: ubuntu-latest
permissions:
packages: read
steps:
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: pull
run: |
docker pull ghcr.io/username/terraform-provider-skopeo/alpine:latest
这些步骤的输出是:
Logging into ghcr.io...
Login Succeeded!
和
Error response from daemon: unauthorized
不太确定授权问题出在哪里。