File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 1
1
# Alert when there are new GitHub Stars utilizing keepstate
2
2
workflow :
3
3
id : new-github-stars
4
- description : Get new GitHub Stars
4
+ description : Notify Slack about new GitHub star for keephq/keep
5
5
triggers :
6
6
- type : interval
7
7
value : 300
@@ -20,7 +20,7 @@ workflow:
20
20
condition :
21
21
- name : assert-condition
22
22
type : assert
23
- assert : " {{ steps.get-github-stars.results.new_stargazers_count }} == 0" # if there are more than 0 new stargazers, trigger the action
23
+ assert : " {{ steps.get-github-stars.results.new_stargazers_count }} > 0" # if there are more than 0 new stargazers, trigger the action
24
24
provider :
25
25
type : slack
26
26
config : " {{ providers.slack-demo }} "
Original file line number Diff line number Diff line change @@ -343,10 +343,6 @@ def _finish_workflow_execution(
343
343
status : WorkflowStatus ,
344
344
error = None ,
345
345
):
346
- # get the previous workflow execution id
347
- previous_execution = get_previous_execution_id (
348
- tenant_id , workflow_id , workflow_execution_id
349
- )
350
346
# mark the workflow execution as finished in the db
351
347
finish_workflow_execution_db (
352
348
tenant_id = tenant_id ,
@@ -355,10 +351,15 @@ def _finish_workflow_execution(
355
351
status = status .value ,
356
352
error = error ,
357
353
)
354
+ # get the previous workflow execution id
355
+ previous_execution = get_previous_execution_id (
356
+ tenant_id , workflow_id , workflow_execution_id
357
+ )
358
358
# if error, send an email
359
- if (
360
- status == WorkflowStatus .ERROR
361
- and previous_execution .status != WorkflowStatus .ERROR .value
359
+ if status == WorkflowStatus .ERROR and (
360
+ previous_execution
361
+ is None # this means this is the first execution, for example
362
+ or previous_execution .status != WorkflowStatus .ERROR .value
362
363
):
363
364
workflow = get_workflow_db (tenant_id = tenant_id , workflow_id = workflow_id )
364
365
self .logger .info (
You can’t perform that action at this time.
0 commit comments