- cancel running jobs if the event is push
- Add a new function `CancelRunningJobs` to cancel all running jobs of a
run
- Update `FindRunOptions` struct to include `Ref` field and update its
condition in `toConds` function
- Implement auto cancellation of running jobs in the same workflow in
`notify` function
related task: https://github.com/go-gitea/gitea/pull/22751/
---------
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: delvh <dev.lh@web.de>
Indexint64`xorm:"index unique(repo_index)"`// a unique number for each run of a repository
Indexint64`xorm:"index unique(repo_index)"`// a unique number for each run of a repository
TriggerUserIDint64`xorm:"index"`
TriggerUserIDint64`xorm:"index"`
TriggerUser*user_model.User`xorm:"-"`
TriggerUser*user_model.User`xorm:"-"`
Refstring
Refstring`xorm:"index"`// the commit/tag/… that caused the run
CommitSHAstring
CommitSHAstring
IsForkPullRequestbool// If this is triggered by a PR from a forked repository or an untrusted user, we need to check if it is approved and limit permissions when running the workflow.
IsForkPullRequestbool// If this is triggered by a PR from a forked repository or an untrusted user, we need to check if it is approved and limit permissions when running the workflow.
NeedApprovalbool// may need approval if it's a fork pull request
NeedApprovalbool// may need approval if it's a fork pull request