@7n/rules-ci-github 2.3.0 → 2.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.3.1] - 2026-08-19
4
+
5
+ ### Changed
6
+
7
+ - дозволено preinstalled ci-tools у lint-ga policy
8
+
3
9
  ## [2.3.0] - 2026-08-01
4
10
 
5
11
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7n/rules-ci-github",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Плагін @7n/rules: канон GitHub Actions (.github/workflows) — обов'язкові workflow, zizmor, VS Code",
5
5
  "keywords": [
6
6
  "github-actions",
@@ -19,4 +19,12 @@ Rego-пакет: `ga.lint_ga`
19
19
  - `steps[*].run` (сукупно) — містить `open-policy-agent/conftest` (Install conftest)
20
20
  - `steps[*].run` (сукупно) — містить `n-rules lint ga --no-fix`
21
21
 
22
+ ### Preinstalled `ci-tools`
23
+
24
+ Forgejo runner може мапити сумісну мітку `ubuntu-latest` на власний образ, де вже
25
+ встановлені `uv` і `conftest`. Для цього workflow декларативно встановлює
26
+ `jobs.lint-ga.env.NITRA_CI_TOOLS: 'true'`. За цієї явної opt-in policy не вимагає
27
+ `astral-sh/setup-uv` і крок завантаження Conftest; `checkout`, локальний
28
+ `setup-bun-deps` і `n-rules lint ga --no-fix` лишаються обов'язковими.
29
+
22
30
  Канон: [lint-ga.yml.snippet.yml](./template/lint-ga.yml.snippet.yml)
@@ -43,6 +43,24 @@ expected_uses_set contains u if {
43
43
  u != ""
44
44
  }
45
45
 
46
+ # Opt-in для runner-образу, у якому вже є uv та conftest. Мітка runner
47
+ # залишається `ubuntu-latest` для сумісності, але workflow явно декларує
48
+ # джерело tooling, щоб policy не приховувала залежність від custom image.
49
+ preinstalled_ci_tools if object.get(object.get(job, "env", {}), "NITRA_CI_TOOLS", false) == true
50
+
51
+ preinstalled_ci_tools if object.get(object.get(job, "env", {}), "NITRA_CI_TOOLS", "false") == "true"
52
+
53
+ required_uses_set contains u if {
54
+ not preinstalled_ci_tools
55
+ some u in expected_uses_set
56
+ }
57
+
58
+ required_uses_set contains u if {
59
+ preinstalled_ci_tools
60
+ some u in expected_uses_set
61
+ not startswith(u, "astral-sh/setup-uv@")
62
+ }
63
+
46
64
  # Required `run:` substrings — collected from steps with `run`.
47
65
  expected_run_blob := concat("\n", [r |
48
66
  some step in data.template.snippet.jobs["lint-ga"].steps
@@ -98,12 +116,13 @@ deny contains msg if {
98
116
  }
99
117
 
100
118
  deny contains msg if {
101
- some required_use in expected_uses_set
119
+ some required_use in required_uses_set
102
120
  not job_has_use_satisfying(required_use)
103
121
  msg := sprintf("lint-ga.yml: має бути uses: %s (ga.mdc)", [required_use])
104
122
  }
105
123
 
106
124
  deny contains msg if {
125
+ not preinstalled_ci_tools
107
126
  expected_run_blob != ""
108
127
  not contains(job_run_blob, "open-policy-agent/conftest")
109
128
  msg := "lint-ga.yml: має бути крок Install conftest (ga.mdc)"