bitwarden_workflow_linter 1.3.0__tar.gz → 1.3.2__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.
Files changed (94) hide show
  1. bitwarden_workflow_linter-1.3.2/.github/workflows/scan.yml +56 -0
  2. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/PKG-INFO +1 -1
  3. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/__about__.py +1 -1
  4. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/default_actions.json +5 -0
  5. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/rules/check_pr_target.py +2 -1
  6. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/rules/test_check_pr_target.py +16 -16
  7. bitwarden_workflow_linter-1.3.0/.github/workflows/scan.yml +0 -126
  8. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.editorconfig +0 -0
  9. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.gitattributes +0 -0
  10. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/CODEOWNERS +0 -0
  11. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  12. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  13. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/actionlint.yml +0 -0
  14. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/renovate.json +0 -0
  15. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/_version_type.yml +0 -0
  16. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/bwwl_operations.yml +0 -0
  17. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/cd.yml +0 -0
  18. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/ci.yml +0 -0
  19. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/enforce-labels.yml +0 -0
  20. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/examples/ci.yaml +0 -0
  21. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/examples/example-references/_build.yml +0 -0
  22. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/examples/example-references/_docker.yml +0 -0
  23. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/examples/example-references/_test.yml +0 -0
  24. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/examples/example-references/_version.yml +0 -0
  25. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/examples/example.yaml +0 -0
  26. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/examples/pull_request_target.yml +0 -0
  27. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.github/workflows/examples/scan.yaml +0 -0
  28. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.gitignore +0 -0
  29. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.husky/pre-commit +0 -0
  30. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/.python-version +0 -0
  31. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/CONTRIBUTING.md +0 -0
  32. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/LICENSE.txt +0 -0
  33. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/Pipfile +0 -0
  34. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/Pipfile.lock +0 -0
  35. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/README.md +0 -0
  36. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/RULE_ROLLOUT.md +0 -0
  37. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/SECURITY.md +0 -0
  38. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/Taskfile.yml +0 -0
  39. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/package-lock.json +0 -0
  40. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/package.json +0 -0
  41. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/pylintrc +0 -0
  42. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/pyproject.toml +0 -0
  43. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/pyproject.toml.tpl +0 -0
  44. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/settings.yaml +0 -0
  45. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/__init__.py +0 -0
  46. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/actionlint_version.yaml +0 -0
  47. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/actions.py +0 -0
  48. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/cli.py +0 -0
  49. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/default_settings.yaml +0 -0
  50. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/lint.py +0 -0
  51. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/load.py +0 -0
  52. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/models/__init__.py +0 -0
  53. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/models/job.py +0 -0
  54. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/models/step.py +0 -0
  55. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/models/workflow.py +0 -0
  56. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/rule.py +0 -0
  57. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/rules/__init__.py +0 -0
  58. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/rules/job_environment_prefix.py +0 -0
  59. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/rules/name_capitalized.py +0 -0
  60. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/rules/name_exists.py +0 -0
  61. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/rules/permissions_exist.py +0 -0
  62. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/rules/pinned_job_runner.py +0 -0
  63. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/rules/run_actionlint.py +0 -0
  64. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/rules/step_approved.py +0 -0
  65. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/rules/step_pinned.py +0 -0
  66. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/rules/underscore_outputs.py +0 -0
  67. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/src/bitwarden_workflow_linter/utils.py +0 -0
  68. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/__init__.py +0 -0
  69. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/conftest.py +0 -0
  70. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/fixtures/test-alt.yml +0 -0
  71. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/fixtures/test-min-incorrect.yaml +0 -0
  72. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/fixtures/test-min.yaml +0 -0
  73. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/fixtures/test-outputs-incorrect.yml +0 -0
  74. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/fixtures/test.yml +0 -0
  75. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/fixtures/test_a.yaml +0 -0
  76. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/fixtures/test_workflow.yaml +0 -0
  77. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/fixtures/test_workflow_incorrect.yaml +0 -0
  78. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/rules/__init__.py +0 -0
  79. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/rules/test_job_environment_prefix.py +0 -0
  80. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/rules/test_name_capitalized.py +0 -0
  81. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/rules/test_name_exists.py +0 -0
  82. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/rules/test_permissions_exist.py +0 -0
  83. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/rules/test_pinned_job_runner.py +0 -0
  84. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/rules/test_run_actionlint.py +0 -0
  85. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/rules/test_step_approved.py +0 -0
  86. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/rules/test_step_pinned.py +0 -0
  87. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/rules/test_underscore_output.py +0 -0
  88. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/test_job.py +0 -0
  89. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/test_lint.py +0 -0
  90. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/test_load.py +0 -0
  91. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/test_rule.py +0 -0
  92. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/test_step.py +0 -0
  93. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/test_utils.py +0 -0
  94. {bitwarden_workflow_linter-1.3.0 → bitwarden_workflow_linter-1.3.2}/tests/test_workflow.py +0 -0
@@ -0,0 +1,56 @@
1
+ name: Scan
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - "main"
8
+ - "rc"
9
+ - "hotfix-rc"
10
+ pull_request:
11
+ types: [opened, synchronize, reopened]
12
+ branches-ignore:
13
+ - main
14
+ pull_request_target:
15
+ types: [opened, synchronize, reopened]
16
+ branches:
17
+ - "main"
18
+
19
+ permissions: {}
20
+
21
+ jobs:
22
+ check-run:
23
+ name: Check PR run
24
+ uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
25
+ permissions:
26
+ contents: read
27
+
28
+ sast:
29
+ name: Checkmarx
30
+ uses: bitwarden/gh-actions/.github/workflows/_checkmarx.yml@main
31
+ needs: check-run
32
+ secrets:
33
+ AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
34
+ AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
35
+ AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
36
+ permissions:
37
+ contents: read
38
+ pull-requests: write
39
+ security-events: write
40
+ id-token: write
41
+
42
+ quality:
43
+ name: Sonar
44
+ uses: bitwarden/gh-actions/.github/workflows/_sonar.yml@main
45
+ needs: check-run
46
+ secrets:
47
+ AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
48
+ AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
49
+ AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
50
+ permissions:
51
+ contents: read
52
+ pull-requests: write
53
+ id-token: write
54
+ with:
55
+ sonar-sources: "src/"
56
+ sonar-tests: "tests/"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bitwarden_workflow_linter
3
- Version: 1.3.0
3
+ Version: 1.3.2
4
4
  Summary: Custom GitHub Action Workflow Linter
5
5
  Project-URL: Homepage, https://github.com/bitwarden/workflow-linter
6
6
  Project-URL: Issues, https://github.com/bitwarden/workflow-linter/issues
@@ -1,3 +1,3 @@
1
1
  """Metadata for Workflow Linter."""
2
2
 
3
- __version__ = "1.3.0"
3
+ __version__ = "1.3.2"
@@ -379,6 +379,11 @@
379
379
  "sha": "276d7966e389d888f011539a86c8920025ea0626",
380
380
  "version": "v3.0.1"
381
381
  },
382
+ "peter-evans/repository-dispatch": {
383
+ "name": "peter-evans/repository-dispatch",
384
+ "sha": "ff45666b9427631e3450c54a1bcbee4d9ff4d7c0",
385
+ "version": "v3.0.0"
386
+ },
382
387
  "reactivecircus/android-emulator-runner": {
383
388
  "name": "reactivecircus/android-emulator-runner",
384
389
  "sha": "62dbb605bba737720e10b196cb4220d374026a6d",
@@ -58,7 +58,8 @@ class RuleCheckPrTarget(Rule):
58
58
  result, check_job = self.has_check_run(obj)
59
59
  main_branch_only = self.targets_main_branch(obj)
60
60
  if not main_branch_only:
61
- Errors.append("Workflows using pull_request_target can only target the main branch")
61
+ default_branch = self.settings.default_branch
62
+ Errors.append(f"Workflows using pull_request_target can only target the '{default_branch}' branch")
62
63
  if result:
63
64
  missing_jobs = self.check_run_required(obj, check_job)
64
65
  if missing_jobs:
@@ -30,13 +30,13 @@ jobs:
30
30
  check-run:
31
31
  name: Check PR run
32
32
  uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
33
-
33
+
34
34
  quality:
35
35
  name: Quality scan
36
36
  needs: check-run
37
37
  steps:
38
38
  - run: echo test
39
-
39
+
40
40
  dependent-job:
41
41
  name: Another Dependent Job
42
42
  needs:
@@ -85,7 +85,7 @@ jobs:
85
85
  runs-on: ubuntu-22.04
86
86
  steps:
87
87
  - run: echo test
88
-
88
+
89
89
  quality:
90
90
  name: Quality scan
91
91
  steps:
@@ -124,13 +124,13 @@ jobs:
124
124
  check-run:
125
125
  name: Check PR run
126
126
  uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
127
-
127
+
128
128
  quality:
129
129
  name: Quality scan
130
130
  needs: check-run
131
131
  steps:
132
132
  - run: echo test
133
-
133
+
134
134
  dependent-job:
135
135
  name: Another Dependent Job
136
136
  needs:
@@ -153,13 +153,13 @@ jobs:
153
153
  check-run:
154
154
  name: Check PR run
155
155
  uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
156
-
156
+
157
157
  quality:
158
158
  name: Quality scan
159
159
  needs: check-run
160
160
  steps:
161
161
  - run: echo test
162
-
162
+
163
163
  dependent-job:
164
164
  name: Another Dependent Job
165
165
  needs:
@@ -186,13 +186,13 @@ jobs:
186
186
  check-run:
187
187
  name: Check PR run
188
188
  uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
189
-
189
+
190
190
  quality:
191
191
  name: Quality scan
192
192
  needs: check-run
193
193
  steps:
194
194
  - run: echo test
195
-
195
+
196
196
  dependent-job:
197
197
  name: Another Dependent Job
198
198
  needs:
@@ -216,13 +216,13 @@ jobs:
216
216
  check-run:
217
217
  name: Check PR run
218
218
  uses: bitwarden/some-other-repo/.github/workflows/check-run.yml@main
219
-
219
+
220
220
  quality:
221
221
  name: Quality scan
222
222
  needs: check-run
223
223
  steps:
224
224
  - run: echo test
225
-
225
+
226
226
  dependent-job:
227
227
  name: Another Dependent Job
228
228
  needs:
@@ -269,11 +269,11 @@ def test_targets_main_branch_no_default_branch(mock_workflow):
269
269
  with patch("src.bitwarden_workflow_linter.utils.Settings.factory") as mock_factory:
270
270
  # Simulate the default settings returned by the factory
271
271
  mock_factory.return_value = Settings(default_branch="main")
272
-
272
+
273
273
  # Use the mocked factory to create the Settings instance
274
274
  settings = Settings.factory()
275
275
  rule = RuleCheckPrTarget(settings=settings)
276
-
276
+
277
277
  # Assert that the workflow targets the main branch
278
278
  assert rule.targets_main_branch(mock_workflow) is True
279
279
 
@@ -317,14 +317,14 @@ def test_rule_on_dependencies_without_check(rule, dependent_missing_check_workfl
317
317
  def test_rule_on_no_branches_workflow(rule, no_branches_workflow):
318
318
  result, message = rule.fn(no_branches_workflow)
319
319
  assert result is False
320
- assert message == "Workflows using pull_request_target can only target the main branch"
320
+ assert message == "Workflows using pull_request_target can only target the 'main' branch"
321
321
 
322
322
  def test_rule_on_only_target_main(rule, bad_branches_workflow):
323
323
  result, message = rule.fn(bad_branches_workflow)
324
324
  assert result is False
325
- assert message == "Workflows using pull_request_target can only target the main branch"
325
+ assert message == "Workflows using pull_request_target can only target the 'main' branch"
326
326
 
327
327
  def test_rule_on_two_failures(rule, two_failures_workflow):
328
328
  result, message = rule.fn(two_failures_workflow)
329
329
  assert result is False
330
- assert message == "Workflows using pull_request_target can only target the main branch\nA check-run job must be included as a direct job dependency when pull_request_target is used"
330
+ assert message == "Workflows using pull_request_target can only target the 'main' branch\nA check-run job must be included as a direct job dependency when pull_request_target is used"
@@ -1,126 +0,0 @@
1
- name: Scan
2
-
3
- on:
4
- workflow_dispatch:
5
- push:
6
- branches:
7
- - "main"
8
- - "rc"
9
- - "hotfix-rc"
10
- pull_request:
11
- types: [opened, synchronize, reopened]
12
- branches-ignore:
13
- - main
14
- pull_request_target:
15
- types: [opened, synchronize, reopened]
16
- branches:
17
- - "main"
18
-
19
- permissions: {}
20
-
21
- jobs:
22
- check-run:
23
- name: Check PR run
24
- uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
25
- permissions:
26
- contents: read
27
-
28
- sast:
29
- name: SAST scan
30
- runs-on: ubuntu-22.04
31
- needs: check-run
32
- permissions:
33
- contents: read
34
- pull-requests: write
35
- security-events: write
36
- id-token: write
37
-
38
- steps:
39
- - name: Check out repo
40
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
41
- with:
42
- ref: ${{ github.event.pull_request.head.sha }}
43
-
44
- - name: Log in to Azure
45
- uses: bitwarden/gh-actions/azure-login@main
46
- with:
47
- subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
48
- tenant_id: ${{ secrets.AZURE_TENANT_ID }}
49
- client_id: ${{ secrets.AZURE_CLIENT_ID }}
50
-
51
- - name: Get Azure Key Vault secrets
52
- id: get-kv-secrets
53
- uses: bitwarden/gh-actions/get-keyvault-secrets@main
54
- with:
55
- keyvault: gh-org-bitwarden
56
- secrets: "CHECKMARX-TENANT,CHECKMARX-CLIENT-ID,CHECKMARX-SECRET"
57
-
58
- - name: Log out from Azure
59
- uses: bitwarden/gh-actions/azure-logout@main
60
-
61
- - name: Scan with Checkmarx
62
- uses: checkmarx/ast-github-action@ef93013c95adc60160bc22060875e90800d3ecfc # 2.3.19
63
- env:
64
- INCREMENTAL: "${{ contains(github.event_name, 'pull_request') && '--sast-incremental' || '' }}"
65
- with:
66
- project_name: ${{ github.repository }}
67
- cx_tenant: ${{ steps.get-kv-secrets.outputs.CHECKMARX-TENANT }}
68
- base_uri: https://ast.checkmarx.net/
69
- cx_client_id: ${{ steps.get-kv-secrets.outputs.CHECKMARX-CLIENT-ID }}
70
- cx_client_secret: ${{ steps.get-kv-secrets.outputs.CHECKMARX-SECRET }}
71
- additional_params: |
72
- --report-format sarif \
73
- --filter "state=TO_VERIFY;PROPOSED_NOT_EXPLOITABLE;CONFIRMED;URGENT" \
74
- --output-path . ${{ env.INCREMENTAL }}
75
-
76
- - name: Upload Checkmarx results to GitHub
77
- uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
78
- with:
79
- sarif_file: cx_result.sarif
80
- sha: ${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.sha || github.sha }}
81
- ref: ${{ contains(github.event_name, 'pull_request') && format('refs/pull/{0}/head', github.event.pull_request.number) || github.ref }}
82
-
83
- quality:
84
- name: Quality scan
85
- runs-on: ubuntu-22.04
86
- needs: check-run
87
- permissions:
88
- contents: read
89
- pull-requests: write
90
- id-token: write
91
-
92
- steps:
93
- - name: Check out repo
94
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
95
- with:
96
- fetch-depth: 0
97
- ref: ${{ github.event.pull_request.head.sha }}
98
-
99
- - name: Log in to Azure
100
- uses: bitwarden/gh-actions/azure-login@main
101
- with:
102
- subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
103
- tenant_id: ${{ secrets.AZURE_TENANT_ID }}
104
- client_id: ${{ secrets.AZURE_CLIENT_ID }}
105
-
106
- - name: Get Azure Key Vault secrets
107
- id: get-kv-secrets
108
- uses: bitwarden/gh-actions/get-keyvault-secrets@main
109
- with:
110
- keyvault: gh-org-bitwarden
111
- secrets: "SONAR-TOKEN"
112
-
113
- - name: Log out from Azure
114
- uses: bitwarden/gh-actions/azure-logout@main
115
-
116
- - name: Scan with SonarCloud
117
- uses: sonarsource/sonarqube-scan-action@2500896589ef8f7247069a56136f8dc177c27ccf # v5.2.0
118
- env:
119
- SONAR_TOKEN: ${{ steps.get-kv-secrets.outputs.SONAR-TOKEN }}
120
- with:
121
- args: >
122
- -Dsonar.organization=${{ github.repository_owner }}
123
- -Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }}
124
- -Dsonar.sources=src/
125
- -Dsonar.tests=tests/
126
- -Dsonar.pullrequest.key=${{ github.event.pull_request.number }}