From c2c0f2e1644353c4fe428fc139525680bb42f391 Mon Sep 17 00:00:00 2001 From: Chl Date: Thu, 29 Aug 2024 03:41:12 +0200 Subject: [PATCH] adaptations forgejo/github --- .forgejo/workflows/generate-release-zipfile.yml | 1 - action.yml | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/generate-release-zipfile.yml b/.forgejo/workflows/generate-release-zipfile.yml index 8fd97cb..9d08901 100644 --- a/.forgejo/workflows/generate-release-zipfile.yml +++ b/.forgejo/workflows/generate-release-zipfile.yml @@ -34,7 +34,6 @@ jobs: set -x printf "steps.uploading.outputs.artifact-id: %s\n" "${{ steps.uploading.outputs.artifact-id }}" printf "steps.uploading.outputs.artifact-url: %s\n" "${{ steps.uploading.outputs.artifact-url }}" - printf "$GITHUB_RUN_ID\n" - name: Check the content of the uploaded artifact run: | diff --git a/action.yml b/action.yml index 95e524f..37c4224 100644 --- a/action.yml +++ b/action.yml @@ -93,7 +93,12 @@ runs: # Store the outputs ARTIFACT_ID="$( echo "$RESPONSE" | sed -n 's/.*"artifactId" *: *"\([^"]\+\)".*/\1/p' )" echo artifact-id="$ARTIFACT_ID" >> $GITHUB_OUTPUT - echo artifact-url="$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY"/actions/runs/"$GITHUB_RUN_ID"/artifacts/"$ARTIFACT_ID" >> $GITHUB_OUTPUT + if [ "$GITHUB_SERVER_URL" = "https://github.com" ]; then + echo artifact-url="$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY"/actions/runs/"$GITHUB_RUN_ID"/artifacts/"$ARTIFACT_ID" >> $GITHUB_OUTPUT + else + # Gitea & Forgejo : github.run_number instead of github.run_id and name of the artifact instead of artifact_id + echo artifact-url="$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY"/actions/runs/"$GITHUB_RUN_NUMBER"/artifacts/"${{ input.name }}" >> $GITHUB_OUTPUT + fi # Cleanup if [ "${{ inputs.compression }}" == "true" ]; then