From 02ac89c01d16c020e26270f7d7ea1d163f0574b0 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 13 Mar 2024 00:31:45 +0800 Subject: [PATCH] Use Get but not Post to get actions artifacts (#29734) (#29737) backport #29734 (cherry picked from commit 8c31456a879797e7247d2cbf65b53fd16939c91d) --- routers/web/web.go | 2 +- web_src/js/components/RepoActionView.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/routers/web/web.go b/routers/web/web.go index 9499363fa9..db4b6b272e 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -1369,7 +1369,7 @@ func registerRoutes(m *web.Route) { }) m.Post("/cancel", reqRepoActionsWriter, actions.Cancel) m.Post("/approve", reqRepoActionsWriter, actions.Approve) - m.Post("/artifacts", actions.ArtifactsView) + m.Get("/artifacts", actions.ArtifactsView) m.Get("/artifacts/{artifact_name}", actions.ArtifactsDownloadView) m.Post("/rerun", reqRepoActionsWriter, actions.Rerun) }) diff --git a/web_src/js/components/RepoActionView.vue b/web_src/js/components/RepoActionView.vue index 797869b78c..28f4d3af4c 100644 --- a/web_src/js/components/RepoActionView.vue +++ b/web_src/js/components/RepoActionView.vue @@ -5,7 +5,7 @@ import {createApp} from 'vue'; import {toggleElem} from '../utils/dom.js'; import {getCurrentLocale} from '../utils.js'; import {renderAnsi} from '../render/ansi.js'; -import {POST} from '../modules/fetch.js'; +import {GET, POST} from '../modules/fetch.js'; const sfc = { name: 'RepoActionView', @@ -196,7 +196,7 @@ const sfc = { }, async fetchArtifacts() { - const resp = await POST(`${this.actionsURL}/runs/${this.runIndex}/artifacts`); + const resp = await GET(`${this.actionsURL}/runs/${this.runIndex}/artifacts`); return await resp.json(); },