bitwarden_workflow_linter 1.1.7__tar.gz → 1.1.8__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 (93) hide show
  1. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/bwwl_operations.yml +18 -5
  2. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/cd.yml +43 -14
  3. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/examples/example-references/_docker.yml +11 -2
  4. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/examples/example.yaml +26 -3
  5. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/examples/scan.yaml +66 -30
  6. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/scan.yml +40 -4
  7. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/PKG-INFO +1 -1
  8. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/__about__.py +1 -1
  9. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.editorconfig +0 -0
  10. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.gitattributes +0 -0
  11. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/CODEOWNERS +0 -0
  12. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  13. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  14. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/actionlint.yml +0 -0
  15. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/renovate.json +0 -0
  16. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/_version_type.yml +0 -0
  17. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/ci.yml +0 -0
  18. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/enforce-labels.yml +0 -0
  19. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/examples/ci.yaml +0 -0
  20. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/examples/example-references/_build.yml +0 -0
  21. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/examples/example-references/_test.yml +0 -0
  22. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/examples/example-references/_version.yml +0 -0
  23. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.github/workflows/examples/pull_request_target.yml +0 -0
  24. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.gitignore +0 -0
  25. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.husky/pre-commit +0 -0
  26. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/.python-version +0 -0
  27. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/CONTRIBUTING.md +0 -0
  28. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/LICENSE.txt +0 -0
  29. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/Pipfile +0 -0
  30. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/Pipfile.lock +0 -0
  31. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/README.md +0 -0
  32. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/RULE_ROLLOUT.md +0 -0
  33. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/SECURITY.md +0 -0
  34. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/Taskfile.yml +0 -0
  35. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/package-lock.json +0 -0
  36. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/package.json +0 -0
  37. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/pylintrc +0 -0
  38. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/pyproject.toml +0 -0
  39. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/pyproject.toml.tpl +0 -0
  40. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/settings.yaml +0 -0
  41. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/__init__.py +0 -0
  42. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/actionlint_version.yaml +0 -0
  43. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/actions.py +0 -0
  44. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/cli.py +0 -0
  45. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/default_actions.json +0 -0
  46. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/default_settings.yaml +0 -0
  47. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/lint.py +0 -0
  48. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/load.py +0 -0
  49. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/models/__init__.py +0 -0
  50. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/models/job.py +0 -0
  51. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/models/step.py +0 -0
  52. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/models/workflow.py +0 -0
  53. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/rule.py +0 -0
  54. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/rules/__init__.py +0 -0
  55. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/rules/check_pr_target.py +0 -0
  56. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/rules/job_environment_prefix.py +0 -0
  57. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/rules/name_capitalized.py +0 -0
  58. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/rules/name_exists.py +0 -0
  59. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/rules/permissions_exist.py +0 -0
  60. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/rules/pinned_job_runner.py +0 -0
  61. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/rules/run_actionlint.py +0 -0
  62. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/rules/step_approved.py +0 -0
  63. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/rules/step_pinned.py +0 -0
  64. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/rules/underscore_outputs.py +0 -0
  65. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/src/bitwarden_workflow_linter/utils.py +0 -0
  66. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/__init__.py +0 -0
  67. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/conftest.py +0 -0
  68. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/fixtures/test-alt.yml +0 -0
  69. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/fixtures/test-min-incorrect.yaml +0 -0
  70. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/fixtures/test-min.yaml +0 -0
  71. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/fixtures/test-outputs-incorrect.yml +0 -0
  72. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/fixtures/test.yml +0 -0
  73. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/fixtures/test_a.yaml +0 -0
  74. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/fixtures/test_workflow.yaml +0 -0
  75. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/fixtures/test_workflow_incorrect.yaml +0 -0
  76. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/rules/__init__.py +0 -0
  77. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/rules/test_check_pr_target.py +0 -0
  78. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/rules/test_job_environment_prefix.py +0 -0
  79. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/rules/test_name_capitalized.py +0 -0
  80. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/rules/test_name_exists.py +0 -0
  81. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/rules/test_permissions_exist.py +0 -0
  82. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/rules/test_pinned_job_runner.py +0 -0
  83. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/rules/test_run_actionlint.py +0 -0
  84. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/rules/test_step_approved.py +0 -0
  85. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/rules/test_step_pinned.py +0 -0
  86. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/rules/test_underscore_output.py +0 -0
  87. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/test_job.py +0 -0
  88. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/test_lint.py +0 -0
  89. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/test_load.py +0 -0
  90. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/test_rule.py +0 -0
  91. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/test_step.py +0 -0
  92. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/test_utils.py +0 -0
  93. {bitwarden_workflow_linter-1.1.7 → bitwarden_workflow_linter-1.1.8}/tests/test_workflow.py +0 -0
@@ -20,6 +20,7 @@ jobs:
20
20
  runs-on: ubuntu-24.04
21
21
  permissions:
22
22
  contents: write
23
+ id-token: write
23
24
  pull-requests: write
24
25
  env:
25
26
  _ACTION: ${{ inputs.action }}
@@ -28,10 +29,12 @@ jobs:
28
29
  if: ${{ inputs.operation == 'add' && !env._ACTION }}
29
30
  run: echo "Action input is required for operation 'add'" && exit 1
30
31
 
31
- - name: Login to Azure - CI Subscription
32
- uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
32
+ - name: Log in to Azure
33
+ uses: bitwarden/gh-actions/azure-login@main
33
34
  with:
34
- creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
35
+ subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
36
+ tenant_id: ${{ secrets.AZURE_TENANT_ID }}
37
+ client_id: ${{ secrets.AZURE_CLIENT_ID }}
35
38
 
36
39
  - name: Retrieve secrets
37
40
  id: retrieve-secrets
@@ -41,6 +44,16 @@ jobs:
41
44
  secrets: "github-gpg-private-key,
42
45
  github-gpg-private-key-passphrase"
43
46
 
47
+ - name: Get Azure Key Vault secrets
48
+ id: get-kv-secrets
49
+ uses: bitwarden/gh-actions/get-keyvault-secrets@main
50
+ with:
51
+ keyvault: gh-org-bitwarden
52
+ secrets: "BW-GHAPP-ID,BW-GHAPP-KEY"
53
+
54
+ - name: Log out from Azure
55
+ uses: bitwarden/gh-actions/azure-logout@main
56
+
44
57
  - name: Checkout Branch
45
58
  uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46
59
 
@@ -112,8 +125,8 @@ jobs:
112
125
  uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
113
126
  id: app-token
114
127
  with:
115
- app-id: ${{ secrets.BW_GHAPP_ID }}
116
- private-key: ${{ secrets.BW_GHAPP_KEY }}
128
+ app-id: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-ID }}
129
+ private-key: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-KEY }}
117
130
 
118
131
  - name: Create PR
119
132
  if: ${{ steps.new-changes.outputs.new_changes == 'TRUE' }}
@@ -14,27 +14,29 @@ jobs:
14
14
  name: Get version type
15
15
  if: github.event.pull_request.merged == true
16
16
  uses: ./.github/workflows/_version_type.yml
17
+ permissions:
18
+ contents: read
19
+ issues: read
20
+ pull-requests: read
17
21
 
18
22
  version-bump:
19
23
  name: Version bump
20
24
  if: needs.version-type.outputs.version_bump_type != 'skip'
21
25
  runs-on: ubuntu-24.04
22
26
  needs: version-type
27
+ permissions:
28
+ contents: write
29
+ id-token: write
23
30
  outputs:
24
31
  version: ${{ steps.get-version.outputs.version }}
25
32
  commit_hash: ${{ steps.version-commit.outputs.commit_hash }}
26
33
  steps:
27
- - name: Generate GH App token
28
- uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
29
- id: app-token
30
- with:
31
- app-id: ${{ secrets.BW_GHAPP_ID }}
32
- private-key: ${{ secrets.BW_GHAPP_KEY }}
33
-
34
- - name: Login to Azure - CI Subscription
35
- uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
34
+ - name: Log in to Azure
35
+ uses: bitwarden/gh-actions/azure-login@main
36
36
  with:
37
- creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
37
+ subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
38
+ tenant_id: ${{ secrets.AZURE_TENANT_ID }}
39
+ client_id: ${{ secrets.AZURE_CLIENT_ID }}
38
40
 
39
41
  - name: Retrieve secrets
40
42
  id: retrieve-secrets
@@ -44,6 +46,23 @@ jobs:
44
46
  secrets: "github-gpg-private-key,
45
47
  github-gpg-private-key-passphrase"
46
48
 
49
+ - name: Get Azure Key Vault secrets
50
+ id: get-kv-secrets
51
+ uses: bitwarden/gh-actions/get-keyvault-secrets@main
52
+ with:
53
+ keyvault: gh-org-bitwarden
54
+ secrets: "BW-GHAPP-ID,BW-GHAPP-KEY"
55
+
56
+ - name: Log out from Azure
57
+ uses: bitwarden/gh-actions/azure-logout@main
58
+
59
+ - name: Generate GH App token
60
+ uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
61
+ id: app-token
62
+ with:
63
+ app-id: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-ID }}
64
+ private-key: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-KEY }}
65
+
47
66
  - name: Check out repo
48
67
  uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
49
68
  with:
@@ -92,7 +111,7 @@ jobs:
92
111
  git tag v$VERSION
93
112
  git push
94
113
  git push --tags
95
-
114
+
96
115
  - name: Output version bump commit hash
97
116
  id: version-commit
98
117
  run: |
@@ -102,6 +121,8 @@ jobs:
102
121
  name: GitHub release
103
122
  runs-on: ubuntu-22.04
104
123
  needs: version-bump
124
+ permissions:
125
+ contents: write
105
126
  steps:
106
127
  - name: Check out repo
107
128
  uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -119,6 +140,9 @@ jobs:
119
140
  name: Deploy workflow-linter (v2)
120
141
  runs-on: ubuntu-22.04
121
142
  needs: version-bump
143
+ permissions:
144
+ contents: read
145
+ id-token: write
122
146
  steps:
123
147
  - name: Check out repo
124
148
  uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -134,10 +158,12 @@ jobs:
134
158
  - name: Install hatch
135
159
  run: pip install hatch
136
160
 
137
- - name: Login to Azure - CI Subscription
138
- uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
161
+ - name: Log in to Azure
162
+ uses: bitwarden/gh-actions/azure-login@main
139
163
  with:
140
- creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
164
+ subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
165
+ tenant_id: ${{ secrets.AZURE_TENANT_ID }}
166
+ client_id: ${{ secrets.AZURE_CLIENT_ID }}
141
167
 
142
168
  - name: Retrieve pypi api token
143
169
  id: retrieve-secret
@@ -146,6 +172,9 @@ jobs:
146
172
  keyvault: "bitwarden-ci"
147
173
  secrets: "pypi-api-token"
148
174
 
175
+ - name: Log out from Azure
176
+ uses: bitwarden/gh-actions/azure-logout@main
177
+
149
178
  - name: Build
150
179
  run: hatch build
151
180
 
@@ -25,6 +25,9 @@ jobs:
25
25
  docker:
26
26
  name: Docker
27
27
  runs-on: ubuntu-22.04
28
+ permissions:
29
+ contents: read
30
+ id-token: write
28
31
  steps:
29
32
  - name: Check out repository
30
33
  uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -33,9 +36,11 @@ jobs:
33
36
 
34
37
  - name: Log in to Azure
35
38
  if: ${{ inputs.push-docker-image }}
36
- uses: Azure/login@a65d910e8af852a8061c627c456678983e180302 # v1.6.1
39
+ uses: bitwarden/gh-actions/azure-login@main
37
40
  with:
38
- creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
41
+ subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
42
+ tenant_id: ${{ secrets.AZURE_TENANT_ID }}
43
+ client_id: ${{ secrets.AZURE_CLIENT_ID }}
39
44
 
40
45
  - name: Log in to ACR
41
46
  if: ${{ inputs.push-docker-image }}
@@ -81,3 +86,7 @@ jobs:
81
86
  tags: ${{ steps.tag-list.outputs.tags }}
82
87
  env:
83
88
  DOCKER_BUILD_RECORD_UPLOAD: false
89
+
90
+ - name: Log out from Azure
91
+ if: ${{ inputs.push-docker-image }}
92
+ uses: bitwarden/gh-actions/azure-logout@main
@@ -6,8 +6,8 @@
6
6
 
7
7
  name: Build
8
8
 
9
- permissions:
10
- read-all # Sets permissions of the GITHUB_TOKEN
9
+ permissions: # Sets permissions of the GITHUB_TOKEN (Can be set at the workflow level or job level)
10
+ contents: read
11
11
  # More info: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions
12
12
 
13
13
  on: # Describes when to run the workflow
@@ -83,6 +83,9 @@ jobs: # A workflow run is made up of one or more jobs that can run sequentially
83
83
  second-job:
84
84
  name: Second Job Name
85
85
  runs-on: ubuntu-22.04 # The type of runner that the job will run on, not available if "uses" is used
86
+ permissions:
87
+ contents: read
88
+ id-token: write # Required to fetch an OpenID Connect (OIDC) token
86
89
  defaults:
87
90
  run: # Set the default shell and working directory
88
91
  shell: bash
@@ -92,6 +95,26 @@ jobs: # A workflow run is made up of one or more jobs that can run sequentially
92
95
  - first-job # This job will wait until first-job completes
93
96
  # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/setting-a-default-shell-and-working-directory
94
97
  steps:
98
+ # Using Azure go obtain secrets from Azure Key Vault
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
+ # Obtain the Key Vault secrets and use them later via GitHub outputs
107
+ - name: Get Azure Key Vault secrets
108
+ id: get-kv-secrets
109
+ uses: bitwarden/gh-actions/get-keyvault-secrets@main
110
+ with:
111
+ keyvault: gh-REPOSITORY_NAME_EXAMPLE # The name of the Azure Key Vault created for this repossitory
112
+ secrets: "SECRETS-OR-CREDENTIALS,ANOTHER-SECRET" # Comma-separated list of secrets to retrieve from Azure Key Vault
113
+
114
+ # Logout to remove access to Azure Key Vault secrets
115
+ - name: Log out from Azure
116
+ uses: bitwarden/gh-actions/azure-logout@main
117
+
95
118
  - name: Descriptive step name
96
119
  # NOT RECOMMENDED if: always() # run even if previous steps failed or the workflow is canceled, this can cause a workflow run to hang indefinitely
97
120
  if: failure() # run when any previous step of a job fails
@@ -100,7 +123,7 @@ jobs: # A workflow run is made up of one or more jobs that can run sequentially
100
123
  with: # Parameters specific to this action that need to be defined in order for the step to be completed
101
124
  fetch-depth: 0 # Full git history for actions that rely on whether a change has occurred
102
125
  ref: ${{ github.event.pull_request.head.sha }}
103
- creds: ${{ secrets.SECRETS_OR_CREDENTIALS }}
126
+ creds: ${{ steps.get-kv-secrets.outputs.SECRETS-OR-CREDENTIALS }} # Use the secrets retrieved from Azure Key Vault in the previous step
104
127
  - name: Another descriptive step name
105
128
  # Run a script instead of an existing github action
106
129
  run: |
@@ -52,6 +52,7 @@ jobs:
52
52
  pull-requests: write # For github actions to upload feedback to PR
53
53
  # For github/codeql-action/upload-sarif to upload SARIF results
54
54
  security-events: write
55
+ id-token: write # For bitwarden/gh-actions/azure-login to get an ID token
55
56
 
56
57
  # Steps represent a sequence of tasks executed as part of the job
57
58
  steps:
@@ -65,33 +66,50 @@ jobs:
65
66
  # in order for the step to be completed
66
67
  ref: ${{ github.event.pull_request.head.sha }}
67
68
 
69
+ - name: Log in to Azure
70
+ uses: bitwarden/gh-actions/azure-login@main
71
+ with:
72
+ subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
73
+ tenant_id: ${{ secrets.AZURE_TENANT_ID }}
74
+ client_id: ${{ secrets.AZURE_CLIENT_ID }}
75
+
76
+ - name: Get Azure Key Vault secrets
77
+ id: get-kv-secrets
78
+ uses: bitwarden/gh-actions/get-keyvault-secrets@main
79
+ with:
80
+ keyvault: gh-org-bitwarden
81
+ secrets: "CHECKMARX-TENANT,CHECKMARX-CLIENT-ID,CHECKMARX-SECRET"
82
+
83
+ - name: Log out from Azure
84
+ uses: bitwarden/gh-actions/azure-logout@main
85
+
68
86
  - name: Scan with Checkmarx
69
87
  if: github.event.pull_request.draft == false # Prevent step from running on draft PR
70
88
  uses: checkmarx/ast-github-action@f0869bd1a37fddc06499a096101e6c900e815d81 # 2.0.36
71
89
  # Environment variables set for this step but not accessible by all
72
90
  # workflows, steps or jobs
73
91
  env:
74
- INCREMENTAL:
75
- "${{ contains(github.event_name, 'pull_request') \
76
- && '--sast-incremental' || '' }}"
92
+ INCREMENTAL:
93
+ "${{ contains(github.event_name, 'pull_request') \
94
+ && '--sast-incremental' || '' }}"
77
95
  with:
78
- project_name: ${{ github.repository }}
79
- cx_tenant: ${{ secrets.CHECKMARX_TENANT }}
80
- base_uri: https://ast.checkmarx.net/
81
- cx_client_id: ${{ secrets.CHECKMARX_CLIENT_ID }}
82
- cx_client_secret: ${{ secrets.CHECKMARX_SECRET }}
83
- additional_params: |
84
- --report-format sarif \
85
- --filter \
86
- "state=TO_VERIFY;PROPOSED_NOT_EXPLOITABLE;CONFIRMED;URGENT"\
87
- --output-path . ${{ env.INCREMENTAL }}
96
+ project_name: ${{ github.repository }}
97
+ cx_tenant: ${{ steps.get-kv-secrets.outputs.CHECKMARX-TENANT }}
98
+ base_uri: https://ast.checkmarx.net/
99
+ cx_client_id: ${{ steps.get-kv-secrets.outputs.CHECKMARX-CLIENT-ID }}
100
+ cx_client_secret: ${{ steps.get-kv-secrets.outputs.CHECKMARX-SECRET }}
101
+ additional_params: |
102
+ --report-format sarif \
103
+ --filter \
104
+ "state=TO_VERIFY;PROPOSED_NOT_EXPLOITABLE;CONFIRMED;URGENT"\
105
+ --output-path . ${{ env.INCREMENTAL }}
88
106
 
89
107
  - name: Upload Checkmarx results to GitHub
90
108
  uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
91
109
  with:
92
- sarif_file: cx_result.sarif
93
- sha: ${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.sha || github.sha }}
94
- ref: ${{ contains(github.event_name, 'pull_request') && format('refs/pull/{0}/head', github.event.pull_request.number) || github.ref }}
110
+ sarif_file: cx_result.sarif
111
+ sha: ${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.sha || github.sha }}
112
+ ref: ${{ contains(github.event_name, 'pull_request') && format('refs/pull/{0}/head', github.event.pull_request.number) || github.ref }}
95
113
 
96
114
  quality:
97
115
  name: Quality scan
@@ -100,6 +118,7 @@ jobs:
100
118
  permissions:
101
119
  contents: read
102
120
  pull-requests: write
121
+ id-token: write
103
122
 
104
123
  steps:
105
124
  # Set up whatever resources your environment will need
@@ -107,8 +126,8 @@ jobs:
107
126
  - name: Set up JDK 17
108
127
  uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
109
128
  with:
110
- java-version: 17
111
- distribution: "zulu"
129
+ java-version: 17
130
+ distribution: "zulu"
112
131
  # This step checks out a copy of your repository
113
132
  - name: Set up .NET
114
133
  uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0
@@ -116,18 +135,35 @@ jobs:
116
135
  - name: Install SonarCloud scanner
117
136
  run: dotnet tool install dotnet-sonarscanner -g
118
137
 
138
+ - name: Log in to Azure
139
+ uses: bitwarden/gh-actions/azure-login@main
140
+ with:
141
+ subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
142
+ tenant_id: ${{ secrets.AZURE_TENANT_ID }}
143
+ client_id: ${{ secrets.AZURE_CLIENT_ID }}
144
+
145
+ - name: Get Azure Key Vault secrets
146
+ id: get-kv-secrets
147
+ uses: bitwarden/gh-actions/get-keyvault-secrets@main
148
+ with:
149
+ keyvault: gh-org-bitwarden
150
+ secrets: "SONAR-TOKEN"
151
+
152
+ - name: Log out from Azure
153
+ uses: bitwarden/gh-actions/azure-logout@main
154
+
119
155
  - name: Scan with SonarCloud
120
156
  env:
121
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
122
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123
- # Additional scripts to run outside of a Github Action
157
+ SONAR_TOKEN: ${{ steps.get-kv-secrets.outputs.SONAR-TOKEN }}
158
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
159
+ # Additional scripts to run outside of a Github Action
124
160
  run: |
125
- dotnet-sonarscanner begin /k:" \
126
- ${{ github.repository_owner }}_${{ github.event.repository.name }}" \
127
- /d:sonar.test.inclusions=test/,bitwarden_license/test/ \
128
- /d:sonar.exclusions=test/,bitwarden_license/test/ \
129
- /o:"${{ github.repository_owner }}" \
130
- /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \
131
- /d:sonar.host.url="https://sonarcloud.io"
132
- dotnet build
133
- dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
161
+ dotnet-sonarscanner begin /k:" \
162
+ ${{ github.repository_owner }}_${{ github.event.repository.name }}" \
163
+ /d:sonar.test.inclusions=test/,bitwarden_license/test/ \
164
+ /d:sonar.exclusions=test/,bitwarden_license/test/ \
165
+ /o:"${{ github.repository_owner }}" \
166
+ /d:sonar.token="${{ steps.get-kv-secrets.outputs.SONAR-TOKEN }}" \
167
+ /d:sonar.host.url="https://sonarcloud.io"
168
+ dotnet build
169
+ dotnet-sonarscanner end /d:sonar.token="${{ steps.get-kv-secrets.outputs.SONAR-TOKEN }}"
@@ -33,6 +33,7 @@ jobs:
33
33
  contents: read
34
34
  pull-requests: write
35
35
  security-events: write
36
+ id-token: write
36
37
 
37
38
  steps:
38
39
  - name: Check out repo
@@ -40,16 +41,33 @@ jobs:
40
41
  with:
41
42
  ref: ${{ github.event.pull_request.head.sha }}
42
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
+
43
61
  - name: Scan with Checkmarx
44
62
  uses: checkmarx/ast-github-action@ef93013c95adc60160bc22060875e90800d3ecfc # 2.3.19
45
63
  env:
46
64
  INCREMENTAL: "${{ contains(github.event_name, 'pull_request') && '--sast-incremental' || '' }}"
47
65
  with:
48
66
  project_name: ${{ github.repository }}
49
- cx_tenant: ${{ secrets.CHECKMARX_TENANT }}
67
+ cx_tenant: ${{ steps.get-kv-secrets.outputs.CHECKMARX-TENANT }}
50
68
  base_uri: https://ast.checkmarx.net/
51
- cx_client_id: ${{ secrets.CHECKMARX_CLIENT_ID }}
52
- cx_client_secret: ${{ secrets.CHECKMARX_SECRET }}
69
+ cx_client_id: ${{ steps.get-kv-secrets.outputs.CHECKMARX-CLIENT-ID }}
70
+ cx_client_secret: ${{ steps.get-kv-secrets.outputs.CHECKMARX-SECRET }}
53
71
  additional_params: |
54
72
  --report-format sarif \
55
73
  --filter "state=TO_VERIFY;PROPOSED_NOT_EXPLOITABLE;CONFIRMED;URGENT" \
@@ -69,6 +87,7 @@ jobs:
69
87
  permissions:
70
88
  contents: read
71
89
  pull-requests: write
90
+ id-token: write
72
91
 
73
92
  steps:
74
93
  - name: Check out repo
@@ -77,10 +96,27 @@ jobs:
77
96
  fetch-depth: 0
78
97
  ref: ${{ github.event.pull_request.head.sha }}
79
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
+
80
116
  - name: Scan with SonarCloud
81
117
  uses: sonarsource/sonarqube-scan-action@2500896589ef8f7247069a56136f8dc177c27ccf # v5.2.0
82
118
  env:
83
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
119
+ SONAR_TOKEN: ${{ steps.get-kv-secrets.outputs.SONAR-TOKEN }}
84
120
  with:
85
121
  args: >
86
122
  -Dsonar.organization=${{ github.repository_owner }}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bitwarden_workflow_linter
3
- Version: 1.1.7
3
+ Version: 1.1.8
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.1.7"
3
+ __version__ = "1.1.8"