1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-21 18:11:06 +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 done
# Create admin user and generate runner token # 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 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) docker exec forgejo forgejo forgejo-cli actions register --secret $TOKEN
echo "RUNNER_TOKEN=$TOKEN" > /tmp/runner_token.txt echo "RUNNER_TOKEN=$TOKEN" > /mnt/c/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
- name: Set Runner Token in Windows Environment - name: Set Runner Token in Windows Environment
run: | run: |
@ -129,9 +124,6 @@ jobs:
labels: labels:
- windows:host - windows:host
- docker:docker://node:20 - docker:docker://node:20
server:
url: $env:FORGEJO_URL
token: $env:FORGEJO_RUNNER_SECRET
"@ "@
Set-Content -Path config.yml -Value $configContent Set-Content -Path config.yml -Value $configContent
@ -143,3 +135,4 @@ jobs:
env: env:
FORGEJO_URL: http://localhost:3000 FORGEJO_URL: http://localhost:3000
FORGEJO_RUNNER_SECRET: ${{ env.RUNNER_TOKEN }} FORGEJO_RUNNER_SECRET: ${{ env.RUNNER_TOKEN }}
FORGEJO_RUNNER_HEX_SECRET: ${{ env.RUNNER_HEX_TOKEN }}