@@ -46,7 +46,15 @@ type acceptance struct {
46
46
* boilerplate.Boilerplate
47
47
}
48
48
49
+ func (a * acceptance ) canCreateIssues () bool {
50
+ createIssues := strings .ToLower (a .Action .GetInput ("create_issues" ))
51
+ return createIssues == "true" || createIssues == "yes"
52
+ }
53
+
49
54
func (a * acceptance ) syncTodos (ctx context.Context ) error {
55
+ if ! a .canCreateIssues () {
56
+ return nil
57
+ }
50
58
directory , _ , err := a .getProject ()
51
59
if err != nil {
52
60
return fmt .Errorf ("project: %w" , err )
@@ -63,6 +71,10 @@ func (a *acceptance) syncTodos(ctx context.Context) error {
63
71
}
64
72
65
73
func (a * acceptance ) trigger (ctx context.Context ) (* notify.Notification , error ) {
74
+ err := a .syncTodos (ctx )
75
+ if err != nil {
76
+ return nil , fmt .Errorf ("sync todos: %w" , err )
77
+ }
66
78
vaultURI := a .Action .GetInput ("vault_uri" )
67
79
directory , project , err := a .getProject ()
68
80
if err != nil {
@@ -146,9 +158,8 @@ func (a *acceptance) runWithTimeout(
146
158
147
159
func (a * acceptance ) notifyIfNeeded (ctx context.Context , alert * notify.Notification ) error {
148
160
slackWebhook := a .Action .GetInput ("slack_webhook" )
149
- createIssues := strings .ToLower (a .Action .GetInput ("create_issues" ))
150
161
needsSlack := slackWebhook != ""
151
- needsIssues := createIssues == "true" || createIssues == "yes"
162
+ needsIssues := a . canCreateIssues ()
152
163
needsNotification := needsSlack || needsIssues
153
164
if ! alert .Report .Pass () && needsNotification {
154
165
if needsSlack {
@@ -159,12 +170,6 @@ func (a *acceptance) notifyIfNeeded(ctx context.Context, alert *notify.Notificat
159
170
}
160
171
}
161
172
if needsIssues {
162
- // doesn't seem to pick the right commit hash, so it's better to do it nightly
163
- // see https://github.com/databrickslabs/ucx/issues/3195
164
- err := a .syncTodos (ctx )
165
- if err != nil {
166
- return fmt .Errorf ("sync todos: %w" , err )
167
- }
168
173
for _ , v := range alert .Report {
169
174
if ! v .Failed () {
170
175
continue
0 commit comments