github action Error: buildx failed with: ERROR: denied: permission_denied: write_package
Encounter this error while trying to get my dockerfile build going.
To fix this ensure, you have configure write permission like this:-
name: python-client-prometheus
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
packages: write
And then, also ensure you are using and pushing to the right (current) repository. In my case, my current build repository is called prometheus-monitoring-hello
- name: Build and Push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/${{ github.repository_owner }}/prometheus-monitoring-hello:latest
That's it.
Comments