Avoid creating new action runner token after each update

Hi there,

Everytime I update my gitea act runner, the runner can’t connect to the gitea instance anymore, because the token has already been used. How can I avoid to create a new token on every update of the act runner?

I use docker compose to run the runner:

version: '3.8'
services:
  gitea_runner:
    image: gitea/act_runner
    container_name: GiteaRunner
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - GITEA_RUNNER_NAME=Gitea Runner
      - GITEA_INSTANCE_URL=<my-url>
      - GITEA_RUNNER_REGISTRATION_TOKEN=<my-token>

Thanks!

If anyone has the same issue, this little line added to the compose file fixes the issue:

version: '3.8'
services:
  gitea_runner:
    image: gitea/act_runner
    container_name: GiteaRunner
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - gitea-runner-data:/data           <--------- This line here
    environment:
      - GITEA_RUNNER_NAME=Gitea Runner
      - GITEA_INSTANCE_URL=<my-url>
      - GITEA_RUNNER_REGISTRATION_TOKEN=<my-token>

There is a .runner file within the /data/ folder of the runner, which keeps all the relevant information about the registration. It says in the header of the runner:

  "WARNING": "This file is automatically generated by act-runner. Do not edit it manually unless you know what you are doing. Removing this file will cause act runner to re-register as a new runner.",
1 Like