From 0835bb1115ffdd0f41cff09f5b12915a7f7d823e Mon Sep 17 00:00:00 2001 From: Crown0815 Date: Thu, 22 May 2025 07:59:46 +0200 Subject: [PATCH] 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 --- .github/workflows/windows-tests.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/windows-tests.yml b/.github/workflows/windows-tests.yml index 6cb209f0..c6645bb9 100644 --- a/.github/workflows/windows-tests.yml +++ b/.github/workflows/windows-tests.yml @@ -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 }}