Skip to content

Commit d87698f

Browse files
fix(ci): restore actions/checkout SHA pin + ruff format cli.py
- Restore supply-chain security: pin actions/checkout@v4 to 11d5960a326750d5838078e36cf38b85af677262 (v4.2.2) in ci.yml, publish.yml, and cowork-auto-pr.yml - Apply ruff format to src/deploydiff/cli.py - Addresses reviewer REQUEST_CHANGES on PR #47
1 parent 489b776 commit d87698f

4 files changed

Lines changed: 9 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
python-version: ["3.10", "3.11", "3.12", "3.13"]
1818

1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2
2121
with:
2222
persist-credentials: false
2323

.github/workflows/cowork-auto-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# without this step every run failed with "not a git repository" and no
1717
# PR was ever opened (fleet-wide defect: 11/11 seeded copies lacked it).
1818
- name: Check out the pushed branch
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2
2020
with:
2121
ref: ${{ github.ref_name }}
2222
fetch-depth: 0

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
id-token: write
2222

2323
steps:
24-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2
2525
with:
2626
persist-credentials: false
2727

src/deploydiff/cli.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,13 @@ def main(ctx, no_gate, require_license_flag) -> None:
7373
type=click.Path(exists=True),
7474
help="Pulumi preview JSON file",
7575
)
76-
@click.option(
77-
"-v", "--verbose", is_flag=True, help="Show before/after details for each change"
78-
)
76+
@click.option("-v", "--verbose", is_flag=True, help="Show before/after details for each change")
7977
@click.option(
8078
"--exit-on-destroy",
8179
is_flag=True,
8280
help="Exit with code 1 if the plan contains destructive changes (deletes or replaces)",
8381
)
84-
def preview(
85-
terraform_file, cloudformation_file, pulumi_file, verbose, exit_on_destroy
86-
) -> None:
82+
def preview(terraform_file, cloudformation_file, pulumi_file, verbose, exit_on_destroy) -> None:
8783
"""Preview infrastructure changes from a plan file."""
8884
plan = _load_plan(terraform_file, cloudformation_file, pulumi_file)
8985
if plan is None:
@@ -131,9 +127,7 @@ def preview(
131127
default=None,
132128
help="Exit with code 1 if total monthly cost delta exceeds this value (e.g. 500 for $500)",
133129
)
134-
def cost(
135-
terraform_file, cloudformation_file, pulumi_file, pricing_file, threshold
136-
) -> None:
130+
def cost(terraform_file, cloudformation_file, pulumi_file, pricing_file, threshold) -> None:
137131
"""Estimate monthly cost impact of infrastructure changes. (Pro feature)"""
138132
if _HAS_RH_LICENSE:
139133
from revenueholdings_license import require_tier
@@ -203,9 +197,7 @@ def _load_plan(
203197
if len(provided) == 0:
204198
return None
205199
if len(provided) > 1:
206-
console.print(
207-
"[red]Error: Provide only one source file (--tf, --cfn, or --pulumi)[/red]"
208-
)
200+
console.print("[red]Error: Provide only one source file (--tf, --cfn, or --pulumi)[/red]")
209201
raise SystemExit(1)
210202

211203
if terraform_file:
@@ -218,9 +210,7 @@ def _load_plan(
218210
return None
219211

220212

221-
def _render_costs(
222-
estimates: list[CostEstimate], plan: DeployPlan, console: Console
223-
) -> None:
213+
def _render_costs(estimates: list[CostEstimate], plan: DeployPlan, console: Console) -> None:
224214
"""Render cost estimates to the console."""
225215
from rich import box
226216
from rich.table import Table
@@ -253,9 +243,7 @@ def _render_costs(
253243
if total > 0:
254244
console.print(f"\n[bold red]Total monthly increase: +${total:.2f}[/bold red]")
255245
elif total < 0:
256-
console.print(
257-
f"\n[bold green]Total monthly decrease: -${abs(total):.2f}[/bold green]"
258-
)
246+
console.print(f"\n[bold green]Total monthly decrease: -${abs(total):.2f}[/bold green]")
259247
else:
260248
console.print("\n[bold]Total monthly change: $0.00[/bold]")
261249

0 commit comments

Comments
 (0)