Docker build error with gitea actions (Invalid token specified)

I’m trying to setup workflow for gitea actions.
Here is my build.yaml:

name: Test gitea action
run-name: Test run
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-22.04
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Registry
uses: docker/login-action@v2
with:
registry: myownregistry.com
username: login
password: password
-
name: Build
uses: docker/build-push-action@v4
with:
context: .
tags: myownregistry.com/whoami:latest
load: true

I have an immediate error in the “Build” step:

::group::GitHub Actions runtime token access controls
::endgroup::
::error::Invalid token specified: Cannot read properties of undefined (reading ‘replace’)

I tried

with:
github-token: “nogithub”
secrets: |
GIT_AUTH_TOKEN=“nogithub”
GITHUB_TOKEN=“nogithub”

but the error message even did not change.

I use these labels for my runner:
“ubuntu-latest:docker://catthehacker/ubuntu:act-latest”,
“ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04”,
“ubuntu-20.04:docker://catthehacker/ubuntu:act-20.04”,
“ubuntu-18.04:docker://catthehacker/ubuntu:act-20.04”

I found the fix:
docker/build-push-action@v4 should be changed to docker/build-push-action@v2

1 Like

I think that’s a bug in the action. Just make GITHUB_TOKEN an empty env var and it should work. The issue is already discussed in the gitea act runner repo.
At least it is working here after that change.

Here is issue for anyone who wants to track: #119 - docker/build-push-action can not work in latest version - act_runner - Gitea: Git with a cup of tea