diff options
author | Giteabot <teabot@gitea.io> | 2023-10-30 19:57:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-30 11:57:48 +0000 |
commit | 3c03b7db505816f646ee4b78473cc216f932a790 (patch) | |
tree | 0d7448293c70e6b6440c13bcc79f959115ea0f22 /routers/api | |
parent | ac22116211051e35448391e3b4335bad3bcc5fc5 (diff) | |
download | gitea-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.go | 3 |
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) { |