diff --git a/.gitea/workflows/build-feature.yml b/.gitea/workflows/build-feature.yml index 4aab0c4..bf707c5 100644 --- a/.gitea/workflows/build-feature.yml +++ b/.gitea/workflows/build-feature.yml @@ -145,11 +145,6 @@ jobs: echo "" } > "reports/${SHA8}/index.html" - - name: Publish report index - shell: bash - run: | - bash .ci/scripts/publish-git-pages.sh "reports/${GITHUB_SHA:0:8}" - - name: Set build commit status run: | bash .ci/scripts/report-status.sh success \ diff --git a/scripts/publish-git-pages.sh b/scripts/publish-git-pages.sh index e6c3456..61065ab 100755 --- a/scripts/publish-git-pages.sh +++ b/scripts/publish-git-pages.sh @@ -29,8 +29,14 @@ WORK=$(mktemp -d) TAR=$(mktemp) trap 'rm -rf "$WORK" "$TAR"' EXIT -mkdir -p "$WORK/${OWNER}/${REPO}/reports/${SHA8}" -cp -a "$REPORT_DIR/." "$WORK/${OWNER}/${REPO}/reports/${SHA8}/" +RELPATH="${REPORT_DIR#reports/${SHA8}/}" +if [ "$RELPATH" != "$REPORT_DIR" ] && [ -n "$RELPATH" ]; then + TARGET="$WORK/${OWNER}/${REPO}/reports/${SHA8}/${RELPATH}" +else + TARGET="$WORK/${OWNER}/${REPO}/reports/${SHA8}" +fi +mkdir -p "$TARGET" +cp -a "$REPORT_DIR/." "$TARGET/" cat > "$WORK/${OWNER}/${REPO}/reports/${SHA8}/.meta" <