Skip to content

Commit

Permalink
check 'IsArchived'
Browse files Browse the repository at this point in the history
  • Loading branch information
Zettat123 committed Apr 1, 2024
1 parent 2ff2ec5 commit 3b174e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/actions/notifier_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func notify(ctx context.Context, input *notifyInput) error {
log.Debug("ignore executing %v for event %v whose doer is %v", getMethod(ctx), input.Event, input.Doer.Name)
return nil
}
if input.Repo.IsEmpty {
if input.Repo.IsEmpty || input.Repo.IsArchived {
return nil
}
if unit_model.TypeActions.UnitGlobalDisabled() {
Expand Down Expand Up @@ -501,7 +501,7 @@ func handleSchedules(

// DetectAndHandleSchedules detects the schedule workflows on the default branch and create schedule tasks
func DetectAndHandleSchedules(ctx context.Context, repo *repo_model.Repository) error {
if repo.IsEmpty {
if repo.IsEmpty || repo.IsArchived {
return nil
}

Expand Down
5 changes: 5 additions & 0 deletions services/actions/schedule_tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ func startTasks(ctx context.Context) error {
}
}

if row.Repo.IsArchived {
// Skip if the repo is archived
continue
}

cfg, err := row.Repo.GetUnit(ctx, unit.TypeActions)
if err != nil {
if repo_model.IsErrUnitTypeNotExist(err) {
Expand Down

0 comments on commit 3b174e3

Please sign in to comment.