# Docker build error with gitea actions (Invalid token specified)

**URL:** <https://forum.gitea.com/t/docker-build-error-with-gitea-actions-invalid-token-specified/7060>\
**Category:** Actions\
**Created:** [April 12, 2023, 12:49pm UTC](https://forum.gitea.com/t/docker-build-error-with-gitea-actions-invalid-token-specified/7060 "2023-04-12T12:49:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![crocodylus](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@crocodylus](https://forum.gitea.com/u/crocodylus)\
**Post date:** [April 12, 2023, 12:49pm UTC](https://forum.gitea.com/t/docker-build-error-with-gitea-actions-invalid-token-specified/7060/1 "2023-04-12T12:49:07Z")

</div>

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](http://myownregistry.com)  
username: login  
password: password  
-  
name: Build  
uses: docker/build-push-action@v4  
with:  
context: .  
tags: [myownregistry.com/whoami:latest](http://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”

---

<div class="post-metadata">

**Author:** ![crocodylus](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@crocodylus](https://forum.gitea.com/u/crocodylus)\
**Post date:** [April 13, 2023, 7:58pm UTC](https://forum.gitea.com/t/docker-build-error-with-gitea-actions-invalid-token-specified/7060/2 "2023-04-13T19:58:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vqui](https://avatars.discourse-cdn.com/v4/letter/v/3e96dc/32.png) [@vqui](https://forum.gitea.com/u/vqui)\
**Post date:** [April 27, 2023, 11:09pm UTC](https://forum.gitea.com/t/docker-build-error-with-gitea-actions-invalid-token-specified/7060/3 "2023-04-27T23:09:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jake](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jake](https://forum.gitea.com/u/jake)\
**Post date:** [April 28, 2023, 7:48pm UTC](https://forum.gitea.com/t/docker-build-error-with-gitea-actions-invalid-token-specified/7060/4 "2023-04-28T19:48:56Z")

</div>

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](https://gitea.com/gitea/act_runner/issues/119)
