summaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-10-30 19:57:48 +0800
committerGitHub <noreply@github.com>2023-10-30 11:57:48 +0000
commit3c03b7db505816f646ee4b78473cc216f932a790 (patch)
tree0d7448293c70e6b6440c13bcc79f959115ea0f22 /routers/api
parentac22116211051e35448391e3b4335bad3bcc5fc5 (diff)
downloadgitea-3c03b7db505816f646ee4b78473cc216f932a790.tar.gz
gitea-3c03b7db505816f646ee4b78473cc216f932a790.zip
Fix/upload artifact error windows (#27802) (#27840)
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/actions/artifacts_utils.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/api/actions/artifacts_utils.go b/routers/api/actions/artifacts_utils.go
index 4c93934862..381e7eb16e 100644
--- a/routers/api/actions/artifacts_utils.go
+++ b/routers/api/actions/artifacts_utils.go
@@ -58,7 +58,8 @@ func validateArtifactHash(ctx *ArtifactContext, artifactName string) bool {
func parseArtifactItemPath(ctx *ArtifactContext) (string, string, bool) {
// itemPath is generated from upload-artifact action
// it's formatted as {artifact_name}/{artfict_path_in_runner}
- itemPath := util.PathJoinRel(ctx.Req.URL.Query().Get("itemPath"))
+ // act_runner in host mode on Windows, itemPath is joined by Windows slash '\'
+ itemPath := util.PathJoinRelX(ctx.Req.URL.Query().Get("itemPath"))
artifactName := strings.Split(itemPath, "/")[0]
artifactPath := strings.TrimPrefix(itemPath, artifactName+"/")
if !validateArtifactHash(ctx, artifactName) {