1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-06-27 16:35:58 +00:00

ci: Fix wrong secret type being used

The token must be created differently according to
https://code.forgejo.org/forgejo/runner/src/branch/main/examples/docker-compose/compose-forgejo-and-runner.yml
This commit is contained in:
Crown0815 2025-05-22 07:59:46 +02:00 committed by Crown0815
parent 186a2295ab
commit 0835bb1115

View file

@ -66,15 +66,10 @@ jobs:
done
# Create admin user and generate runner token
TOKEN=$(openssl rand -hex 20)
docker exec forgejo forgejo admin create-user --username test-admin --password test-password --email test@example.com --admin
TOKEN=$(docker exec forgejo forgejo actions generate-runner-token)
echo "RUNNER_TOKEN=$TOKEN" > /tmp/runner_token.txt
- name: Get Runner Token
shell: wsl-bash {0}
run: |
TOKEN=$(cat /tmp/runner_token.txt)
echo "$TOKEN" > /mnt/c/runner_token.txt
docker exec forgejo forgejo forgejo-cli actions register --secret $TOKEN
echo "RUNNER_TOKEN=$TOKEN" > /mnt/c/runner_token.txt
- name: Set Runner Token in Windows Environment
run: |
@ -129,9 +124,6 @@ jobs:
labels:
- windows:host
- docker:docker://node:20
server:
url: $env:FORGEJO_URL
token: $env:FORGEJO_RUNNER_SECRET
"@
Set-Content -Path config.yml -Value $configContent
@ -143,3 +135,4 @@ jobs:
env:
FORGEJO_URL: http://localhost:3000
FORGEJO_RUNNER_SECRET: ${{ env.RUNNER_TOKEN }}
FORGEJO_RUNNER_HEX_SECRET: ${{ env.RUNNER_HEX_TOKEN }}