From 25027fcba86c5c427c3ef6b1f42741c619885b50 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 30 Mar 2023 16:28:59 +0200 Subject: [PATCH] set token from FORGEJO_TOKEN in the test environment --- .forgejo/workflows/integration.yml | 4 ++-- action.yml | 4 ++-- testdata/upload-download/.forgejo/workflows/test.yml | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/integration.yml b/.forgejo/workflows/integration.yml index d309df5..76213ac 100644 --- a/.forgejo/workflows/integration.yml +++ b/.forgejo/workflows/integration.yml @@ -15,8 +15,8 @@ jobs: set -ex export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}" forgejo-test-helper.sh push_self_action http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser forgejo-release vTest - forgejo-test-helper.sh run_workflow testdata/upload-download http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser upload-download forgejo-release - forgejo-test-helper.sh run_workflow testdata/nested-upload-download http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser nested-upload-download forgejo-release + forgejo-test-helper.sh run_workflow testdata/upload-download http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser upload-download forgejo-release "${{ steps.forgejo.outputs.token }}" + forgejo-test-helper.sh run_workflow testdata/nested-upload-download http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser nested-upload-download forgejo-release "${{ steps.forgejo.outputs.token }}" - name: 002 run: | set -ex diff --git a/action.yml b/action.yml index e3aae76..410d190 100644 --- a/action.yml +++ b/action.yml @@ -52,10 +52,10 @@ runs: export DOER="${{ inputs.doer }}" export TOKEN="${{ inputs.token }}" if test -z "$TOKEN"; then - export TOKEN="${{ github.token }}" + export TOKEN="${{ secrets.GITHUB_TOKEN }}" fi if test -z "$TOKEN"; then - export TOKEN="${{ secrets.GITHUB_TOKEN }}" + export TOKEN="${{ github.token }}" fi test "$TOKEN" export RELEASE_DIR="${{ inputs.release-dir }}" diff --git a/testdata/upload-download/.forgejo/workflows/test.yml b/testdata/upload-download/.forgejo/workflows/test.yml index be5e3bb..71a9041 100644 --- a/testdata/upload-download/.forgejo/workflows/test.yml +++ b/testdata/upload-download/.forgejo/workflows/test.yml @@ -10,6 +10,7 @@ jobs: with: direction: upload tag: v1.0 + token: FORGEJO_TOKEN doer: testuser release-dir: upload-dir release-notes: "RELEASE NOTES" @@ -19,6 +20,7 @@ jobs: with: direction: download tag: v1.0 + token: FORGEJO_TOKEN doer: testuser release-dir: download-dir verbose: true