Skip to content

Commit 471a4f4

Browse files
author
cyberphor
committed
Updated CI pipeline
1 parent 7376945 commit 471a4f4

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,5 @@ jobs:
2626
poetry-version: ${{ matrix.poetry-version }}
2727
- name: Install dependencies
2828
run: poetry install
29-
- name: Run tests
30-
run: poetry run pytest --cov=sigma --cov-report term --cov-report xml:cov.xml -vv
31-
- name: Store coverage for badge
32-
if: ${{ runner.os == 'Linux' }}
33-
run: poetry run python print-coverage.py >> $GITHUB_ENV
34-
- name: Create coverage badge
35-
if: ${{ github.repository == 'cyberphor/pySigma-backend-powershell' && github.event_name == 'push' && runner.os == 'Linux' }}
36-
uses: schneegans/[email protected]
37-
with:
38-
auth: ${{ secrets.GIST_SECRET }}
39-
gistID: d3f7db7182e7819f3748e64a2ab2d126
40-
filename: cyberphor-pySigma-backend-powershell.json
41-
label: Coverage
42-
message: ${{ env.COVERAGE }}
43-
color: ${{ env.COVERAGE_COLOR }}
29+
- name: Lint with black
30+
run: poetry run black --check .

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ packages = [
1313
python = "^3.11"
1414
pysigma = "^0.11.14"
1515
pytest = "^8.3.3"
16+
black = "^24.10.0"
1617

1718
[tool.poetry.scripts]
1819
sigma2powershell = "scripts.sigma2powershell:main"

sigma/backends/powershell/powershell.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
class PowerShellBackend(TextQueryBackend):
1111
"""PowerShell backend."""
12+
1213
name: ClassVar[str] = "PowerShell backend"
1314
formats: Dict[str, str] = {
1415
"default": "PowerShell queries",
@@ -205,4 +206,4 @@ class PowerShellBackend(TextQueryBackend):
205206
def finalize_query_default(
206207
self, rule: SigmaRule, query: Any, index: int, state: ConversionState
207208
) -> Any:
208-
return f'-LogName "{rule.logsource.service}" | Read-WinEvent | Where-Object {{{query}}}"'
209+
return f'-LogName "{rule.logsource.service}" | Read-WinEvent | Where-Object {{{query}}}"'

0 commit comments

Comments
 (0)