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.
@@ -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 GitHubApiError, 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
- GitHubApiError,
32
- GitHubSecurityCliError,
33
- json.JSONDecodeError,
34
- ) as exc:
35
- if arguments.json:
36
- print(
37
- json.dumps(
38
- {
39
- "error": {
40
- "command": arguments.command,
41
- "message": str(exc),
42
- "type": type(exc).__name__,
43
- }
44
- },
45
- indent=2,
46
- sort_keys=True,
47
- ),
48
- file=sys.stderr,
49
- )
50
- else:
51
- print(f"Error: {exc}", file=sys.stderr)
52
- return 1
53
-
54
- return 0
55
-
56
-
57
- if __name__ == "__main__":
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())