-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/upload artifact error windows #27802
Fix/upload artifact error windows #27802
Conversation
Isn't that something the runner should do? |
Double encoding would definitely be a bug in the runner. Also |
It's not right to do I think it should figure out the runner's bug first. |
I make a mistake that confusing logs from |
|
From issue go-gitea#27314 When act_runner in `host` mode on Windows. `upload_artifact@v3` actions use `path.join` to generate `itemPath` params when uploading artifact chunk. `itemPath` is encoded as `${artifact_name}\${artifact_path}`. <del>It's twice query escaped from ${artifact_name}/${artifact_path} that joined by Windows slash \.</del> **So we need convert Windows slash to linux**. In go-gitea#27314, runner shows logs from `upload_artifact@v3` like with `%255C`: ``` [artifact-cases/test-artifact-cases] | ::error::Unexpected response. Unable to upload chunk to http://192.168.31.230:3000/api/actions_pipeline/_apis/pipelines/workflows/6/artifacts/34d628a422db9367c869d3fb36be81f5/upload?itemPath=more-files%255Css.json ``` But in gitea server at the same time, But shows `%5C` ``` 2023/10/27 19:29:51 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /api/actions_pipeline/_apis/pipelines/workflows/6/artifacts/34d628a422db9367c869d3fb36be81f5/upload?itemPath=more-files%5Css.json for 192.168.31.230:55340, 400 Bad Request in 17.6ms @ <autogenerated>:1(actions.artifactRoutes.uploadArtifact-fm) ``` I found `%255C` is escaped by `https://github.com/actions/upload-artifact/blob/main/dist/index.js#L2329`. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* giteaofficial/main: Fix package webhook (go-gitea#27839) Add user secrets API integration tests (go-gitea#27832) Fix wrong relative path on obtain token from command line (go-gitea#27850) doc: actions/act-runner: document obtaining a runner registration token from gitea CLI (go-gitea#27845) Fix/upload artifact error windows (go-gitea#27802) Always use whole user name as link (go-gitea#27815) Fix display member unit in the menu bar if there are no hidden members in public org (go-gitea#27795) Add Index to pull_auto_merge.doer_id (go-gitea#27811) Bump workflows in github actions (go-gitea#27836) Allow pull requests Manually Merged option to be used by non-admins (go-gitea#27780)
From issue go-gitea#27314 When act_runner in `host` mode on Windows. `upload_artifact@v3` actions use `path.join` to generate `itemPath` params when uploading artifact chunk. `itemPath` is encoded as `${artifact_name}\${artifact_path}`. <del>It's twice query escaped from ${artifact_name}/${artifact_path} that joined by Windows slash \.</del> **So we need convert Windows slash to linux**. In go-gitea#27314, runner shows logs from `upload_artifact@v3` like with `%255C`: ``` [artifact-cases/test-artifact-cases] | ::error::Unexpected response. Unable to upload chunk to http://192.168.31.230:3000/api/actions_pipeline/_apis/pipelines/workflows/6/artifacts/34d628a422db9367c869d3fb36be81f5/upload?itemPath=more-files%255Css.json ``` But in gitea server at the same time, But shows `%5C` ``` 2023/10/27 19:29:51 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /api/actions_pipeline/_apis/pipelines/workflows/6/artifacts/34d628a422db9367c869d3fb36be81f5/upload?itemPath=more-files%5Css.json for 192.168.31.230:55340, 400 Bad Request in 17.6ms @ <autogenerated>:1(actions.artifactRoutes.uploadArtifact-fm) ``` I found `%255C` is escaped by `https://github.com/actions/upload-artifact/blob/main/dist/index.js#L2329`. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
From issue #27314
When act_runner in
host
mode on Windows.upload_artifact@v3
actions usepath.join
to generateitemPath
params when uploading artifact chunk.itemPath
is encoded as${artifact_name}\${artifact_path}
.It's twice query escaped from ${artifact_name}/${artifact_path} that joined by Windows slash .So we need convert Windows slash to linux.
In #27314, runner shows logs from
upload_artifact@v3
like with%255C
:But in gitea server at the same time, But shows
%5C
I found
%255C
is escaped byhttps://github.com/actions/upload-artifact/blob/main/dist/index.js#L2329
.