Given a public Github repository ( you can find a minimal reproduction repository here https://github.com/matthiashermsen/deleteme ) with a Dockerfile with this content
FROM alpine
and a Github Actions workflow with this content
name: Release
on:
push:
branches:
- 'main'
permissions:
contents: write
packages: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry:
username: github-actions
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
env:
DOCKER_REPOSITORY: ghcr.io/${{ github.repository }}
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.DOCKER_REPOSITORY }}:latest,${{ env.DOCKER_REPOSITORY }}:${{github.run_id}}ghcr.io
I would expect the workflow to be fine but unfortunately the last step fails with the error message
ERROR: failed to solve: failed to push
ghcr.io/matthiashermsen/deleteme:latest: unexpected status from POST
request to https://ghcr.io/v2/matthiashermsen/deleteme/blobs/uploads/:
403 Forbidden Error: buildx failed with: ERROR: failed to solve:
failed to push ghcr.io/matthiashermsen/deleteme:latest: unexpected
status from POST request to
https://ghcr.io/v2/matthiashermsen/deleteme/blobs/uploads/: 403
Forbidden
Is something wrong or am I missing something?