Skip to content

Commit

Permalink
Fix/upload artifact error windows (#27802) (#27840)
Browse files Browse the repository at this point in the history
  • Loading branch information
GiteaBot committed Oct 30, 2023
1 parent ac22116 commit 3c03b7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion routers/api/actions/artifacts_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3c03b7d

Please sign in to comment.