@7n/rules-ci-github 2.4.6 → 2.4.7

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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.4.7] - 2026-08-29
4
+
5
+ ### Changed
6
+
7
+ - `ensure_step_uses_key_present` прибрано цілком — після longhand-правок `lint_ga.rego` (#563) і `lint_text.rego` (#565) жоден вшитий `.rego` не читає `step.uses` незахищеним прямим доступом, тож обхід regorus-бага на боці Rust став мертвим кодом
8
+
9
+ ### Fixed
10
+
11
+ - text/lint_text: `.rego` переписано на longhand-форму `job_uses_set` і позитивне звʼязування актуальних значень перед `not` — workflow без джоби `text` більше не валить пакет у `rego-engine-error`, а віддає канонічний набір `policy-deny`
12
+
3
13
  ## [2.4.6] - 2026-08-29
4
14
 
5
15
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7n/rules-ci-github",
3
- "version": "2.4.6",
3
+ "version": "2.4.7",
4
4
  "description": "Плагін @7n/rules: канон GitHub Actions (.github/workflows) — обов'язкові workflow, zizmor, VS Code",
5
5
  "keywords": [
6
6
  "github-actions",
@@ -29,10 +29,19 @@ gha_on := object.get(input, "on", object.get(input, "true", {}))
29
29
 
30
30
  job := input.jobs.text
31
31
 
32
- job_uses_set contains job.steps[_].uses
32
+ # LONGHAND, а не shorthand `job_uses_set contains job.steps[_].uses`:
33
+ # shorthand-форма падає під regorus з «item cannot be indexed», коли `job`
34
+ # undefined (у workflow немає джоби `text`) або коли крок не має `uses:` —
35
+ # замість канонічного набору `deny` порт віддавав одну `rego-engine-error`.
36
+ # Під OPA обидві форми еквівалентні; longhand — спільний знаменник.
37
+ job_uses_set contains u if {
38
+ some step in job.steps
39
+ u := step.uses
40
+ }
33
41
 
34
- job_run_blob := concat("\n", [run |
35
- run := job.steps[_].run
42
+ job_run_blob := concat("\n", [object.get(step, "run", "") |
43
+ some step in job.steps
44
+ object.get(step, "run", "") != ""
36
45
  ])
37
46
 
38
47
  expected_uses_set contains u if {
@@ -41,10 +50,9 @@ expected_uses_set contains u if {
41
50
  u != ""
42
51
  }
43
52
 
44
- expected_run_substrings contains r if {
53
+ expected_run_substrings contains object.get(step, "run", "") if {
45
54
  some step in data.template.snippet.jobs.text.steps
46
- r := object.get(step, "run", "")
47
- r != ""
55
+ object.get(step, "run", "") != ""
48
56
  }
49
57
 
50
58
  deny contains msg if {
@@ -52,18 +60,25 @@ deny contains msg if {
52
60
  msg := sprintf("lint-text.yml: name має бути \"%v\" (text.mdc)", [expected_name])
53
61
  }
54
62
 
63
+ # Актуальне значення звʼязується ОКРЕМИМ позитивним виразом перед `not`:
64
+ # при undefined-аргументі regorus рахує `not helper(undefined, …)` істиною
65
+ # (зайвий deny), тоді як OPA лишає весь body undefined і deny мовчить.
66
+ # Звʼязування вирівнює обидва рушії на OPA-семантиці.
55
67
  deny contains msg if {
56
- not branches_superset_of(gha_on.push.branches, expected_push_branches)
68
+ actual_push_branches := gha_on.push.branches
69
+ not branches_superset_of(actual_push_branches, expected_push_branches)
57
70
  msg := "lint-text.yml: on.push.branches має містити dev і main (text.mdc)"
58
71
  }
59
72
 
60
73
  deny contains msg if {
61
- not branches_superset_of(gha_on.pull_request.branches, expected_pr_branches)
74
+ actual_pr_branches := gha_on.pull_request.branches
75
+ not branches_superset_of(actual_pr_branches, expected_pr_branches)
62
76
  msg := "lint-text.yml: on.pull_request.branches має містити dev і main (text.mdc)"
63
77
  }
64
78
 
65
79
  deny contains msg if {
66
- not paths_superset_of(gha_on.push.paths, expected_push_paths)
80
+ actual_push_paths := gha_on.push.paths
81
+ not paths_superset_of(actual_push_paths, expected_push_paths)
67
82
  msg := "lint-text.yml: on.push.paths має містити очікувані glob-и (text.mdc)"
68
83
  }
69
84