mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 10:56:10 +01:00 
			
		
		
		
	Check disabled workflow when rerun jobs (#26535)
In GitHub, we can not rerun jobs if the workflow is disabled. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -14,7 +14,7 @@ | ||||
|         <button class="ui basic small compact button red" @click="cancelRun()" v-else-if="run.canCancel"> | ||||
|           {{ locale.cancel }} | ||||
|         </button> | ||||
|         <button class="ui basic small compact button gt-mr-0" @click="rerun()" v-else-if="run.canRerun"> | ||||
|         <button class="ui basic small compact button gt-mr-0 link-action" :data-url="`${run.link}/rerun`" v-else-if="run.canRerun"> | ||||
|           {{ locale.rerun_all }} | ||||
|         </button> | ||||
|       </div> | ||||
| @@ -38,7 +38,7 @@ | ||||
|                 <span class="job-brief-name gt-mx-3 gt-ellipsis">{{ job.name }}</span> | ||||
|               </div> | ||||
|               <span class="job-brief-item-right"> | ||||
|                 <SvgIcon name="octicon-sync" role="button" :data-tooltip-content="locale.rerun" class="job-brief-rerun gt-mx-3" @click="rerunJob(index)" v-if="job.canRerun && onHoverRerunIndex === job.id"/> | ||||
|                 <SvgIcon name="octicon-sync" role="button" :data-tooltip-content="locale.rerun" class="job-brief-rerun gt-mx-3 link-action" :data-url="`${run.link}/jobs/${index}/rerun`" v-if="job.canRerun && onHoverRerunIndex === job.id"/> | ||||
|                 <span class="step-summary-duration">{{ job.duration }}</span> | ||||
|               </span> | ||||
|             </a> | ||||
| @@ -264,17 +264,6 @@ const sfc = { | ||||
|         this.loadJob(); // try to load the data immediately instead of waiting for next timer interval | ||||
|       } | ||||
|     }, | ||||
|     // rerun a job | ||||
|     async rerunJob(idx) { | ||||
|       const jobLink = `${this.run.link}/jobs/${idx}`; | ||||
|       await this.fetchPost(`${jobLink}/rerun`); | ||||
|       window.location.href = jobLink; | ||||
|     }, | ||||
|     // rerun workflow | ||||
|     async rerun() { | ||||
|       await this.fetchPost(`${this.run.link}/rerun`); | ||||
|       window.location.href = this.run.link; | ||||
|     }, | ||||
|     // cancel a run | ||||
|     cancelRun() { | ||||
|       this.fetchPost(`${this.run.link}/cancel`); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user