From cb070c9a9605e1038d2ff47a4fcad368bd75e91d Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 30 Mar 2023 15:37:51 +0200 Subject: [PATCH] fallback to env.GITHUB_SERVER_URL if FORGEJO is not set --- action.yml | 5 ++++- testdata/upload-download/.forgejo/workflows/test.yml | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index d6f0127..e3aae76 100644 --- a/action.yml +++ b/action.yml @@ -36,8 +36,11 @@ runs: - run: | export FORGEJO="${{ inputs.url }}" if test -z "$FORGEJO"; then - export FORGEJO="${{ github.server_url }}" + export FORGEJO="${{ env.GITHUB_SERVER_URL }}" fi + # A trailing / will mean http://forgejo//api/v1 is used + # and it always 401 as of v1.19, because of the double slash + FORGEJO=${FORGEJO%%/} export REPO="${{ inputs.repo }}" if test -z "$REPO"; then export REPO="${{ github.repository }}" diff --git a/testdata/upload-download/.forgejo/workflows/test.yml b/testdata/upload-download/.forgejo/workflows/test.yml index ec626d6..be5e3bb 100644 --- a/testdata/upload-download/.forgejo/workflows/test.yml +++ b/testdata/upload-download/.forgejo/workflows/test.yml @@ -8,7 +8,6 @@ jobs: - id: release-upload uses: SELF@vTest with: - url: FORGEJO_URL direction: upload tag: v1.0 doer: testuser @@ -18,7 +17,6 @@ jobs: - id: release-download uses: SELF@vTest with: - url: FORGEJO_URL direction: download tag: v1.0 doer: testuser