]> source.dussan.org Git - gitea.git/commitdiff
Use Get but not Post to get actions artifacts (#29734) (#29737)
authorLunny Xiao <xiaolunwen@gmail.com>
Tue, 12 Mar 2024 16:31:45 +0000 (00:31 +0800)
committerGitHub <noreply@github.com>
Tue, 12 Mar 2024 16:31:45 +0000 (17:31 +0100)
backport #29734

routers/web/web.go
web_src/js/components/RepoActionView.vue

index 103c03f45a2ecceb9230ae88a7b6e11f03550bd9..d3749b7d29744505f322f385f65f263b7dc8c21d 100644 (file)
@@ -1360,7 +1360,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)
                        })
index 797869b78cead6742598958c470200f93f9bee40..28f4d3af4ccdb12e40e6e1d3a6e899809ad86a6b 100644 (file)
@@ -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();
     },