github-manage-security-alerts-skill 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SKILL.md +233 -233
- package/package.json +3 -4
- package/scripts/github_security_api.py +360 -358
- package/scripts/github_security_cli.py +848 -835
- package/scripts/github_security_common.py +103 -103
- package/scripts/github_security_operations.py +1246 -1162
- package/scripts/github_security_render.py +310 -318
- package/scripts/manage_github_security_alerts.py +57 -58
|
@@ -1,58 +1,57 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Inspect and manage GitHub repository security alerts."""
|
|
3
|
-
|
|
4
|
-
from __future__ import annotations
|
|
5
|
-
|
|
6
|
-
import json
|
|
7
|
-
import sys
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
|
|
10
|
-
SCRIPT_DIR = Path(__file__).resolve().parent
|
|
11
|
-
if str(SCRIPT_DIR) not in sys.path:
|
|
12
|
-
sys.path.insert(0, str(SCRIPT_DIR))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def main() -> int:
|
|
16
|
-
"""CLI entry point."""
|
|
17
|
-
|
|
18
|
-
from github_security_api import
|
|
19
|
-
from github_security_cli import parse_args
|
|
20
|
-
from github_security_common import GitHubSecurityCliError
|
|
21
|
-
from github_security_operations import handle_command
|
|
22
|
-
from github_security_render import emit_output
|
|
23
|
-
|
|
24
|
-
arguments = parse_args()
|
|
25
|
-
|
|
26
|
-
try:
|
|
27
|
-
context = resolve_context(arguments)
|
|
28
|
-
payload = handle_command(context, arguments)
|
|
29
|
-
emit_output(payload, as_json=arguments.json, command=arguments.command)
|
|
30
|
-
except (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
raise SystemExit(main())
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Inspect and manage GitHub repository security alerts."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import json
|
|
7
|
+
import sys
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
SCRIPT_DIR = Path(__file__).resolve().parent
|
|
11
|
+
if str(SCRIPT_DIR) not in sys.path:
|
|
12
|
+
sys.path.insert(0, str(SCRIPT_DIR))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def main() -> int:
|
|
16
|
+
"""CLI entry point."""
|
|
17
|
+
|
|
18
|
+
from github_security_api import resolve_context
|
|
19
|
+
from github_security_cli import parse_args
|
|
20
|
+
from github_security_common import GitHubSecurityCliError
|
|
21
|
+
from github_security_operations import handle_command
|
|
22
|
+
from github_security_render import emit_output
|
|
23
|
+
|
|
24
|
+
arguments = parse_args()
|
|
25
|
+
|
|
26
|
+
try:
|
|
27
|
+
context = resolve_context(arguments)
|
|
28
|
+
payload = handle_command(context, arguments)
|
|
29
|
+
emit_output(payload, as_json=arguments.json, command=arguments.command)
|
|
30
|
+
except (
|
|
31
|
+
GitHubSecurityCliError,
|
|
32
|
+
json.JSONDecodeError,
|
|
33
|
+
) as exc:
|
|
34
|
+
if arguments.json:
|
|
35
|
+
print(
|
|
36
|
+
json.dumps(
|
|
37
|
+
{
|
|
38
|
+
"error": {
|
|
39
|
+
"command": arguments.command,
|
|
40
|
+
"message": str(exc),
|
|
41
|
+
"type": type(exc).__name__,
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
indent=2,
|
|
45
|
+
sort_keys=True,
|
|
46
|
+
),
|
|
47
|
+
file=sys.stderr,
|
|
48
|
+
)
|
|
49
|
+
else:
|
|
50
|
+
print(f"Error: {exc}", file=sys.stderr)
|
|
51
|
+
return 1
|
|
52
|
+
|
|
53
|
+
return 0
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
if __name__ == "__main__":
|
|
57
|
+
raise SystemExit(main())
|