From a453057e98aea71a679628c06166c80b746efe70 Mon Sep 17 00:00:00 2001 From: NielsAD Date: Sat, 12 Mar 2022 10:41:28 +0100 Subject: [PATCH] Remove invalid characters in artifact names --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af6bbbb..bf24e37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,19 +36,21 @@ jobs: - name: Prepare artifacts run: | + REF_NAME=$(echo "${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}" | sed 's/[^a-zA-Z0-9\-_.]/-/g') + echo "ref_name=$REF_NAME" >> $GITHUB_ENV echo -e "Author: Niels A.D. Project: autoindex (https://github.com/nielsAD/autoindex) Platform: `go env GOOS`/`go env GOARCH` (`go env GOVERSION`) - Release: $GITHUB_REF_NAME ($GITHUB_SHA) + Release: $REF_NAME ($GITHUB_SHA) Date: `date --utc`" > VERSION.txt - mv autoindex.exe autoindex-$GITHUB_REF_NAME.exe || true - mv autoindex autoindex-$GITHUB_REF_NAME || true + mv autoindex.exe autoindex-$REF_NAME.exe || true + mv autoindex autoindex-$REF_NAME || true mv LICENSE LICENSE.txt - name: Upload artifacts uses: actions/upload-artifact@v2 with: - name: autoindex_${{ github.ref_name }}_${{ runner.os }} + name: autoindex_${{ env.ref_name }}_${{ runner.os }} path: | autoindex-* LICENSE.txt