Skip to content

Unexpected status from HEAD #1240

@RainbowZephyr

Description

@RainbowZephyr

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

Hello,
I am having trouble pushing to Github's container registry from the CI, I keep getting:

ERROR: failed to solve: failed to push ghcr.io/nomuwdev/nomuw-gateway:0.1.5: unexpected status from HEAD request to https://ghcr.io/v2/nomuwdev/nomuw-gateway/blobs/sha256:47289e83a07a72d51da5a8aa17e424eaf900f89d6df10d6a408f8c2afe22de22: 403 Forbidden

I have another repo under that organization and the pipeline works and pushes the images normally. #981 mentions renaming the tag in image, which I tried but still no avail. Read and write permissions are enabled for the actions in the repo settings and this is the workflow file:

Expected behaviour

The image should be built and pushed to Github container registry

Actual behaviour

Fails with error code 403 forbidden

Repository URL

No response

Workflow run URL

No response

YAML workflow

name: CI for staging branch

env:
  VERSION: '0.1.5'

on:
  push:
    branches:
      - staging

  pull_request:
    branches:
      - staging

jobs:
  deploy:
    runs-on: [ self-hosted, Linux, X64 ]

    steps:
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Log in to GitHub Container Registry
        uses: docker/login-action@v3
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Build and push Docker image
        uses: docker/build-push-action@v5
        with:
          context: .
          push: true
          tags: ghcr.io/${{ github.repository }}:staging-${{ env.VERSION }}

Workflow logs

No response

BuildKit logs

No response

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions