File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 * [ reader] ( https://github.com/podhmo/kamidana/blob/master/kamidana/additionals/reader.py )
1212* kamidana-action additonals
1313 * [ color] ( additionals/color.py )
14+ * is_success
15+ * is_failure
1416 * (as_global) status_success_color
1517 * (as_global) status_failure_color
1618 * (as_global) status_other_color
3537 * listdir
3638 * listdir_files
3739 * listdir_dirs
38- * [ status] ( additionals/status.py )
39- * is_success
40- * is_failure
4140 * [ to_yaml] ( additionals/to_yaml.py )
4241 * to_yaml
4342 * to_nice_yaml
Original file line number Diff line number Diff line change 77import os
88
99
10+ success_texts = [
11+ "success" ,
12+ "succeeded" ,
13+ "pass" ,
14+ "passed" ,
15+ "ok" ,
16+ ]
17+
18+ failure_texts = [
19+ "failure" ,
20+ "failed" ,
21+ "fail" ,
22+ "error" ,
23+ "errored" ,
24+ "ng" ,
25+ ]
26+
27+
28+ @as_filter
29+ @pass_context
30+ def is_success (ctx , v ):
31+ if isinstance (v , str ):
32+ return v .lower () in success_texts
33+ if v :
34+ return True
35+ return False
36+
37+
38+ @as_filter
39+ @pass_context
40+ def is_failure (ctx , v ):
41+ if isinstance (v , str ):
42+ return v .lower () in failure_texts
43+ if v :
44+ return True
45+ return False
46+
47+
1048@as_global
1149def status_success_color ():
1250 return Color (os .getenv ('KAMIDANA_STATUS_SUCCESS' , '#1f883d' ))
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1111 * [reader](https://github.com/podhmo/kamidana/blob/master/kamidana/additionals/reader.py)
1212* kamidana-action additonals
1313 * [color](additionals/color.py)
14+ * is_success
15+ * is_failure
1416 * (as_global) status_success_color
1517 * (as_global) status_failure_color
1618 * (as_global) status_other_color
3537 * listdir
3638 * listdir_files
3739 * listdir_dirs
38- * [status](additionals/status.py)
39- * is_success
40- * is_failure
4140 * [to_yaml](additionals/to_yaml.py)
4241 * to_yaml
4342 * to_nice_yaml
You can’t perform that action at this time.
0 commit comments