pyrig-codeql 1.9.0__tar.gz → 2.1.0__tar.gz
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.
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/PKG-INFO +7 -6
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/README.md +5 -4
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/pyproject.toml +2 -2
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/pyproject.toml.orig +2 -2
- pyrig_codeql-2.1.0/src/pyrig_codeql/rig/configs/version_control/remote/workflows/codeql.py +118 -0
- pyrig_codeql-2.1.0/src/pyrig_codeql/rig/configs/version_control/remote/workflows/health_check.py +37 -0
- pyrig_codeql-1.9.0/src/pyrig_codeql/rig/configs/version_control/remote/workflows/health_check.py +0 -140
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/LICENSE +0 -0
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/__init__.py +0 -0
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/py.typed +0 -0
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/rig/__init__.py +0 -0
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/rig/configs/__init__.py +0 -0
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/rig/configs/version_control/__init__.py +0 -0
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/rig/configs/version_control/remote/__init__.py +0 -0
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/rig/configs/version_control/remote/code_analyzer.py +0 -0
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/rig/configs/version_control/remote/workflows/__init__.py +0 -0
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/rig/resources/ACTION_CODEQL_ANALYZE +0 -0
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/rig/resources/ACTION_CODEQL_INIT +0 -0
- {pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/rig/resources/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyrig-codeql
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: A pyrig plugin that integrates GitHub CodeQL.
|
|
5
5
|
Keywords: pyrig
|
|
6
6
|
Author: Winipedia
|
|
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.14
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.15
|
|
16
16
|
Classifier: Typing :: Typed
|
|
17
|
-
Requires-Dist: pyrig>=19.
|
|
17
|
+
Requires-Dist: pyrig>=19.22.0
|
|
18
18
|
Maintainer: Winipedia
|
|
19
19
|
Maintainer-email: Winipedia <winipedia@gmx.de>
|
|
20
20
|
Requires-Python: >=3.12
|
|
@@ -31,6 +31,7 @@ Description-Content-Type: text/markdown
|
|
|
31
31
|
[](https://github.com/Winipedia/pyrig-codeql/actions/workflows/health-check.yml)
|
|
32
32
|
[](https://github.com/Winipedia/pyrig-codeql/actions/workflows/release.yml)
|
|
33
33
|
[](https://codecov.io/gh/Winipedia/pyrig-codeql)
|
|
34
|
+
[](https://scorecard.dev/viewer/?uri=github.com/Winipedia/pyrig-codeql)
|
|
34
35
|
<!-- code-quality -->
|
|
35
36
|
[](https://prek.j178.dev/reference/built-in-hooks/#fix-byte-order-marker)
|
|
36
37
|
[](https://github.com/rhysd/actionlint)
|
|
@@ -75,7 +76,6 @@ Description-Content-Type: text/markdown
|
|
|
75
76
|
> A pyrig plugin that integrates GitHub CodeQL.
|
|
76
77
|
|
|
77
78
|
---
|
|
78
|
-
|
|
79
79
|
## Overview
|
|
80
80
|
|
|
81
81
|
`pyrig-codeql` is a [pyrig](https://github.com/Winipedia/pyrig) plugin that adds
|
|
@@ -85,9 +85,9 @@ GitHub CodeQL analysis to your project's health-check workflow.
|
|
|
85
85
|
|
|
86
86
|
- **CodeQL analysis** — analyzes Python and GitHub Actions code.
|
|
87
87
|
- **Health-check integration** — adds CodeQL to the aggregate health-check gate.
|
|
88
|
-
- **Alert gate** — fails the
|
|
89
|
-
CodeQL security or quality alerts, including existing findings. Fixed
|
|
90
|
-
dismissed alerts do not block the
|
|
88
|
+
- **Alert gate** — fails the health-check workflow if the analyzed ref has any
|
|
89
|
+
open CodeQL security or quality alerts, including existing findings. Fixed
|
|
90
|
+
and dismissed alerts do not block the check.
|
|
91
91
|
- **Source-only analysis** — excludes the project's `tests/` directory from
|
|
92
92
|
CodeQL analysis.
|
|
93
93
|
|
|
@@ -106,3 +106,4 @@ The plugin requires Python 3.12 or newer.
|
|
|
106
106
|
|
|
107
107
|
Full documentation, including the auto-generated API reference, is available on
|
|
108
108
|
the [documentation site](https://Winipedia.github.io/pyrig-codeql).
|
|
109
|
+
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
[](https://github.com/Winipedia/pyrig-codeql/actions/workflows/health-check.yml)
|
|
5
5
|
[](https://github.com/Winipedia/pyrig-codeql/actions/workflows/release.yml)
|
|
6
6
|
[](https://codecov.io/gh/Winipedia/pyrig-codeql)
|
|
7
|
+
[](https://scorecard.dev/viewer/?uri=github.com/Winipedia/pyrig-codeql)
|
|
7
8
|
<!-- code-quality -->
|
|
8
9
|
[](https://prek.j178.dev/reference/built-in-hooks/#fix-byte-order-marker)
|
|
9
10
|
[](https://github.com/rhysd/actionlint)
|
|
@@ -48,7 +49,6 @@
|
|
|
48
49
|
> A pyrig plugin that integrates GitHub CodeQL.
|
|
49
50
|
|
|
50
51
|
---
|
|
51
|
-
|
|
52
52
|
## Overview
|
|
53
53
|
|
|
54
54
|
`pyrig-codeql` is a [pyrig](https://github.com/Winipedia/pyrig) plugin that adds
|
|
@@ -58,9 +58,9 @@ GitHub CodeQL analysis to your project's health-check workflow.
|
|
|
58
58
|
|
|
59
59
|
- **CodeQL analysis** — analyzes Python and GitHub Actions code.
|
|
60
60
|
- **Health-check integration** — adds CodeQL to the aggregate health-check gate.
|
|
61
|
-
- **Alert gate** — fails the
|
|
62
|
-
CodeQL security or quality alerts, including existing findings. Fixed
|
|
63
|
-
dismissed alerts do not block the
|
|
61
|
+
- **Alert gate** — fails the health-check workflow if the analyzed ref has any
|
|
62
|
+
open CodeQL security or quality alerts, including existing findings. Fixed
|
|
63
|
+
and dismissed alerts do not block the check.
|
|
64
64
|
- **Source-only analysis** — excludes the project's `tests/` directory from
|
|
65
65
|
CodeQL analysis.
|
|
66
66
|
|
|
@@ -79,3 +79,4 @@ The plugin requires Python 3.12 or newer.
|
|
|
79
79
|
|
|
80
80
|
Full documentation, including the auto-generated API reference, is available on
|
|
81
81
|
the [documentation site](https://Winipedia.github.io/pyrig-codeql).
|
|
82
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pyrig-codeql"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "2.1.0"
|
|
4
4
|
description = "A pyrig plugin that integrates GitHub CodeQL."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
@@ -16,7 +16,7 @@ classifiers = [
|
|
|
16
16
|
"Programming Language :: Python :: 3.15",
|
|
17
17
|
"Typing :: Typed",
|
|
18
18
|
]
|
|
19
|
-
dependencies = ["pyrig>=19.
|
|
19
|
+
dependencies = ["pyrig>=19.22.0"]
|
|
20
20
|
|
|
21
21
|
[[project.authors]]
|
|
22
22
|
name = "Winipedia"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pyrig-codeql"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "2.1.0"
|
|
4
4
|
description = "A pyrig plugin that integrates GitHub CodeQL."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
@@ -27,7 +27,7 @@ classifiers = [
|
|
|
27
27
|
"Typing :: Typed",
|
|
28
28
|
]
|
|
29
29
|
dependencies = [
|
|
30
|
-
"pyrig>=19.
|
|
30
|
+
"pyrig>=19.22.0",
|
|
31
31
|
]
|
|
32
32
|
|
|
33
33
|
[project.urls]
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"""Reusable CodeQL analysis and code-scanning alert gate."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Callable
|
|
4
|
+
from typing import Any, override
|
|
5
|
+
|
|
6
|
+
from pyrig.rig.configs.base.workflow import WorkflowConfigFile
|
|
7
|
+
from pyrig.rig.tools.version_control.remote.controller import RemoteVersionController
|
|
8
|
+
|
|
9
|
+
from pyrig_codeql.rig import resources
|
|
10
|
+
from pyrig_codeql.rig.configs.version_control.remote.code_analyzer import (
|
|
11
|
+
CodeAnalyzerConfigFile,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class CodeqlWorkflowConfigFile(WorkflowConfigFile):
|
|
16
|
+
"""Analyze Python and GitHub Actions code and fail on open CodeQL alerts."""
|
|
17
|
+
|
|
18
|
+
@override
|
|
19
|
+
def stem(self) -> str:
|
|
20
|
+
"""Return the workflow filename stem."""
|
|
21
|
+
return "codeql"
|
|
22
|
+
|
|
23
|
+
@override
|
|
24
|
+
def jobs(self) -> tuple[Callable[[], dict[str, Any]], ...]:
|
|
25
|
+
"""Return the analysis and alert-gate jobs."""
|
|
26
|
+
return (self.job_analyze, self.job_check_alerts)
|
|
27
|
+
|
|
28
|
+
@override
|
|
29
|
+
def workflow_triggers(self) -> dict[str, Any]:
|
|
30
|
+
"""Allow invocation only through a reusable-workflow call."""
|
|
31
|
+
return self.on_workflow_call()
|
|
32
|
+
|
|
33
|
+
def job_check_alerts(self) -> dict[str, Any]:
|
|
34
|
+
"""Check CodeQL alerts after all language analyses have completed."""
|
|
35
|
+
return self.job(
|
|
36
|
+
self.job_check_alerts,
|
|
37
|
+
needs=(self.job_analyze,),
|
|
38
|
+
permissions=self.job_check_alerts_permissions(),
|
|
39
|
+
steps=self.steps_check_alerts(),
|
|
40
|
+
timeout_minutes=5,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
def job_analyze(self) -> dict[str, Any]:
|
|
44
|
+
"""Build the matrix job that analyzes Python and workflow code."""
|
|
45
|
+
return self.job(
|
|
46
|
+
self.job_analyze,
|
|
47
|
+
strategy=self.strategy_matrix(
|
|
48
|
+
matrix=self.matrix({"language": ["python", "actions"]}),
|
|
49
|
+
),
|
|
50
|
+
permissions=self.job_analyze_permissions(),
|
|
51
|
+
steps=self.steps_analyze(),
|
|
52
|
+
timeout_minutes=90,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
def job_check_alerts_permissions(self) -> dict[str, str]:
|
|
56
|
+
"""Grant read access to code-scanning alerts."""
|
|
57
|
+
return self.permission("security-events")
|
|
58
|
+
|
|
59
|
+
def steps_check_alerts(self) -> list[dict[str, Any]]:
|
|
60
|
+
"""Return the CodeQL alert-check step."""
|
|
61
|
+
return [self.step_check_alerts()]
|
|
62
|
+
|
|
63
|
+
def job_analyze_permissions(self) -> dict[str, str]:
|
|
64
|
+
"""Grant the permissions required to analyze and upload CodeQL results."""
|
|
65
|
+
return {
|
|
66
|
+
**self.permission_contents(),
|
|
67
|
+
**self.permission("actions"),
|
|
68
|
+
**self.permission("security-events", write=True),
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
def step_check_alerts(self) -> dict[str, Any]:
|
|
72
|
+
"""Fail if the analyzed ref has any open CodeQL alerts."""
|
|
73
|
+
return self.step(
|
|
74
|
+
self.step_check_alerts,
|
|
75
|
+
run=RemoteVersionController.I.api_method_args(
|
|
76
|
+
'--raw-field="ref=${GITHUB_REF}"',
|
|
77
|
+
"--raw-field=state=open",
|
|
78
|
+
"--raw-field=tool_name=CodeQL",
|
|
79
|
+
"""--jq='if . != [] then error("Alerts found") end'""",
|
|
80
|
+
endpoint='"repos/${GITHUB_REPOSITORY}/code-scanning/alerts"',
|
|
81
|
+
method="GET",
|
|
82
|
+
).multiline(),
|
|
83
|
+
env={"GH_TOKEN": self.insert_github_token()},
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
def steps_analyze(self) -> list[dict[str, Any]]:
|
|
87
|
+
"""Return checkout, initialization, and analysis steps."""
|
|
88
|
+
return [
|
|
89
|
+
self.step_checkout_repository(),
|
|
90
|
+
self.step_initialize_codeql(),
|
|
91
|
+
self.step_analyze_code(),
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
def step_analyze_code(self) -> dict[str, Any]:
|
|
95
|
+
"""Run the CodeQL analysis and upload its results."""
|
|
96
|
+
return self.step(
|
|
97
|
+
self.step_analyze_code,
|
|
98
|
+
uses=self.action_codeql_analyze(),
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
def step_initialize_codeql(self) -> dict[str, Any]:
|
|
102
|
+
"""Initialize CodeQL for the current matrix language."""
|
|
103
|
+
return self.step(
|
|
104
|
+
self.step_initialize_codeql,
|
|
105
|
+
uses=self.action_codeql_init(),
|
|
106
|
+
with_={
|
|
107
|
+
"languages": self.insert_expression("matrix.language"),
|
|
108
|
+
"config-file": CodeAnalyzerConfigFile.I.path().as_posix(),
|
|
109
|
+
},
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
def action_codeql_analyze(self) -> tuple[str, str, str]:
|
|
113
|
+
"""Return the pinned CodeQL analyze action metadata."""
|
|
114
|
+
return self.action_from_resource(self.action_codeql_analyze, resources)
|
|
115
|
+
|
|
116
|
+
def action_codeql_init(self) -> tuple[str, str, str]:
|
|
117
|
+
"""Return the pinned CodeQL init action metadata."""
|
|
118
|
+
return self.action_from_resource(self.action_codeql_init, resources)
|
pyrig_codeql-2.1.0/src/pyrig_codeql/rig/configs/version_control/remote/workflows/health_check.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Health check workflow extended with CodeQL analysis and an open-alert gate."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Callable
|
|
4
|
+
from typing import Any, override
|
|
5
|
+
|
|
6
|
+
from pyrig.rig.configs.version_control.remote.workflows.health_check import (
|
|
7
|
+
HealthCheckWorkflowConfigFile as BaseHealthCheckWorkflowConfigFile,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
from pyrig_codeql.rig.configs.version_control.remote.workflows.codeql import (
|
|
11
|
+
CodeqlWorkflowConfigFile,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class HealthCheckWorkflowConfigFile(BaseHealthCheckWorkflowConfigFile):
|
|
16
|
+
"""Include the reusable CodeQL workflow in the health check."""
|
|
17
|
+
|
|
18
|
+
@override
|
|
19
|
+
def jobs_health_check(self) -> tuple[Callable[[], dict[str, Any]], ...]:
|
|
20
|
+
"""Return the base health-check jobs followed by the CodeQL call."""
|
|
21
|
+
return (
|
|
22
|
+
*super().jobs_health_check(),
|
|
23
|
+
self.job_codeql,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
def job_codeql(self) -> dict[str, Any]:
|
|
27
|
+
"""Call the reusable CodeQL workflow."""
|
|
28
|
+
return self.job(
|
|
29
|
+
self.job_codeql,
|
|
30
|
+
uses=CodeqlWorkflowConfigFile.I.workflow_call_reference(),
|
|
31
|
+
permissions=self.job_codeql_permissions() or None,
|
|
32
|
+
secrets=CodeqlWorkflowConfigFile.I.used_secrets_mapping() or None,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
def job_codeql_permissions(self) -> dict[str, str]:
|
|
36
|
+
"""Return the permissions required by the reusable CodeQL workflow."""
|
|
37
|
+
return CodeqlWorkflowConfigFile.I.used_permissions()
|
pyrig_codeql-1.9.0/src/pyrig_codeql/rig/configs/version_control/remote/workflows/health_check.py
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"""Health check workflow extended with CodeQL analysis and an open-alert gate."""
|
|
2
|
-
|
|
3
|
-
from collections.abc import Callable
|
|
4
|
-
from typing import Any, override
|
|
5
|
-
|
|
6
|
-
from pyrig.rig.configs.version_control.remote.workflows.health_check import (
|
|
7
|
-
HealthCheckWorkflowConfigFile as BaseHealthCheckWorkflowConfigFile,
|
|
8
|
-
)
|
|
9
|
-
from pyrig.rig.tools.version_control.remote.controller import RemoteVersionController
|
|
10
|
-
|
|
11
|
-
from pyrig_codeql.rig import resources
|
|
12
|
-
from pyrig_codeql.rig.configs.version_control.remote.code_analyzer import (
|
|
13
|
-
CodeAnalyzerConfigFile,
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class HealthCheckWorkflowConfigFile(BaseHealthCheckWorkflowConfigFile):
|
|
18
|
-
"""Add CodeQL analysis and an open-alert gate to the health check workflow."""
|
|
19
|
-
|
|
20
|
-
@override
|
|
21
|
-
def jobs_health_check(self) -> tuple[Callable[[], dict[str, Any]], ...]:
|
|
22
|
-
"""Return the base job builders, extended with the CodeQL analysis builder.
|
|
23
|
-
|
|
24
|
-
Returns:
|
|
25
|
-
Tuple of the base job builders followed by the CodeQL analysis builder.
|
|
26
|
-
"""
|
|
27
|
-
return (
|
|
28
|
-
*super().jobs_health_check(),
|
|
29
|
-
self.job_analyze,
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
def job_analyze(self) -> dict[str, Any]:
|
|
33
|
-
"""Return the CodeQL analysis job.
|
|
34
|
-
|
|
35
|
-
Returns:
|
|
36
|
-
Job configuration with a matrix over `("python", "actions")`,
|
|
37
|
-
the job's permissions, and steps that fail the job on open
|
|
38
|
-
CodeQL alerts.
|
|
39
|
-
"""
|
|
40
|
-
return self.job(
|
|
41
|
-
self.job_analyze,
|
|
42
|
-
strategy=self.strategy_matrix(
|
|
43
|
-
matrix=self.matrix({"language": ["python", "actions"]}),
|
|
44
|
-
),
|
|
45
|
-
permissions=self.job_analyze_permissions(),
|
|
46
|
-
steps=self.steps_analyze(),
|
|
47
|
-
timeout_minutes=90,
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
def job_analyze_permissions(self) -> dict[str, Any]:
|
|
51
|
-
"""Return the permissions for the CodeQL analysis job.
|
|
52
|
-
|
|
53
|
-
Returns:
|
|
54
|
-
Permissions needed to analyze code (`contents: read`), read
|
|
55
|
-
workflow runs (`actions: read`), and upload results and read
|
|
56
|
-
alerts (`security-events: write`).
|
|
57
|
-
"""
|
|
58
|
-
return {
|
|
59
|
-
**self.permission_contents(),
|
|
60
|
-
**self.permission("actions"),
|
|
61
|
-
**self.permission("security-events", write=True),
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
def steps_analyze(self) -> list[dict[str, Any]]:
|
|
65
|
-
"""Return the steps for the CodeQL analysis job.
|
|
66
|
-
|
|
67
|
-
Returns:
|
|
68
|
-
Steps that check out the repository, initialize CodeQL for the
|
|
69
|
-
current matrix language, run the analysis, and check open alerts.
|
|
70
|
-
"""
|
|
71
|
-
return [
|
|
72
|
-
self.step_checkout_repository(),
|
|
73
|
-
self.step_initialize_codeql(),
|
|
74
|
-
self.step_analyze_code(),
|
|
75
|
-
self.step_check_alerts(),
|
|
76
|
-
]
|
|
77
|
-
|
|
78
|
-
def step_analyze_code(self) -> dict[str, Any]:
|
|
79
|
-
"""Build a step that runs the CodeQL analysis and uploads results.
|
|
80
|
-
|
|
81
|
-
Returns:
|
|
82
|
-
Step using `github/codeql-action/analyze@<ref>`.
|
|
83
|
-
"""
|
|
84
|
-
return self.step(
|
|
85
|
-
self.step_analyze_code,
|
|
86
|
-
uses=self.action_codeql_analyze(),
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
def step_check_alerts(self) -> dict[str, Any]:
|
|
90
|
-
"""Fail if the analyzed ref has any open CodeQL alerts.
|
|
91
|
-
|
|
92
|
-
Returns:
|
|
93
|
-
GitHub CLI step authenticated with the workflow's GitHub token.
|
|
94
|
-
"""
|
|
95
|
-
return self.step(
|
|
96
|
-
self.step_check_alerts,
|
|
97
|
-
run=RemoteVersionController.I.api_method_args(
|
|
98
|
-
'--raw-field="ref=${GITHUB_REF}"',
|
|
99
|
-
"--raw-field=state=open",
|
|
100
|
-
"--raw-field=tool_name=CodeQL",
|
|
101
|
-
"""--jq='if . != [] then error("Alerts found") end'""",
|
|
102
|
-
endpoint='"repos/${GITHUB_REPOSITORY}/code-scanning/alerts"',
|
|
103
|
-
method="GET",
|
|
104
|
-
).multiline(),
|
|
105
|
-
env={"GH_TOKEN": self.insert_expression("secrets.GITHUB_TOKEN")},
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
def step_initialize_codeql(self) -> dict[str, Any]:
|
|
109
|
-
"""Build a step that initializes the CodeQL database.
|
|
110
|
-
|
|
111
|
-
Neither analyzed language is compiled, so no build step is
|
|
112
|
-
required between initialization and analysis.
|
|
113
|
-
|
|
114
|
-
Returns:
|
|
115
|
-
Step using `github/codeql-action/init@<ref>`.
|
|
116
|
-
"""
|
|
117
|
-
return self.step(
|
|
118
|
-
self.step_initialize_codeql,
|
|
119
|
-
uses=self.action_codeql_init(),
|
|
120
|
-
with_={
|
|
121
|
-
"languages": self.insert_expression("matrix.language"),
|
|
122
|
-
"config-file": CodeAnalyzerConfigFile.I.path().as_posix(),
|
|
123
|
-
},
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
def action_codeql_analyze(self) -> tuple[str, str, str]:
|
|
127
|
-
"""Return action metadata for `github/codeql-action/analyze`.
|
|
128
|
-
|
|
129
|
-
Returns:
|
|
130
|
-
Tuple of action name, pinned commit SHA, and release tag.
|
|
131
|
-
"""
|
|
132
|
-
return self.action_from_resource(self.action_codeql_analyze, resources)
|
|
133
|
-
|
|
134
|
-
def action_codeql_init(self) -> tuple[str, str, str]:
|
|
135
|
-
"""Return action metadata for `github/codeql-action/init`.
|
|
136
|
-
|
|
137
|
-
Returns:
|
|
138
|
-
Tuple of action name, pinned commit SHA, and release tag.
|
|
139
|
-
"""
|
|
140
|
-
return self.action_from_resource(self.action_codeql_init, resources)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/rig/configs/version_control/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyrig_codeql-1.9.0 → pyrig_codeql-2.1.0}/src/pyrig_codeql/rig/resources/ACTION_CODEQL_ANALYZE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|