bitwarden_workflow_linter 0.10.0__tar.gz → 0.10.1__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 (92) hide show
  1. bitwarden_workflow_linter-0.10.1/.github/workflows/examples/example.yaml +112 -0
  2. bitwarden_workflow_linter-0.10.1/.github/workflows/examples/scan.yaml +131 -0
  3. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/PKG-INFO +1 -1
  4. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/settings.yaml +2 -3
  5. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/__about__.py +1 -1
  6. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/default_settings.yaml +2 -3
  7. bitwarden_workflow_linter-0.10.0/.github/workflows/examples/example.yaml +0 -100
  8. bitwarden_workflow_linter-0.10.0/.github/workflows/examples/scan.yaml +0 -126
  9. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.editorconfig +0 -0
  10. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.gitattributes +0 -0
  11. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/CODEOWNERS +0 -0
  12. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  13. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  14. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/renovate.json +0 -0
  15. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/workflows/_version_type.yml +0 -0
  16. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/workflows/bwwl_operations.yml +0 -0
  17. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/workflows/cd.yml +0 -0
  18. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/workflows/ci.yml +0 -0
  19. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/workflows/enforce-labels.yml +0 -0
  20. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/workflows/examples/ci.yaml +0 -0
  21. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/workflows/examples/example-references/_build.yml +0 -0
  22. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/workflows/examples/example-references/_docker.yml +0 -0
  23. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/workflows/examples/example-references/_test.yml +0 -0
  24. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/workflows/examples/example-references/_version.yml +0 -0
  25. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.github/workflows/scan.yml +0 -0
  26. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.gitignore +0 -0
  27. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.husky/pre-commit +0 -0
  28. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/.python-version +0 -0
  29. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/CONTRIBUTING.md +0 -0
  30. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/LICENSE.txt +0 -0
  31. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/Pipfile +0 -0
  32. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/Pipfile.lock +0 -0
  33. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/README.md +0 -0
  34. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/RULE_ROLLOUT.md +0 -0
  35. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/SECURITY.md +0 -0
  36. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/Taskfile.yml +0 -0
  37. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/package-lock.json +0 -0
  38. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/package.json +0 -0
  39. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/pylintrc +0 -0
  40. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/pyproject.toml +0 -0
  41. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/pyproject.toml.tpl +0 -0
  42. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/__init__.py +0 -0
  43. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/actions.py +0 -0
  44. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/cli.py +0 -0
  45. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/default_actions.json +0 -0
  46. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/lint.py +0 -0
  47. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/load.py +0 -0
  48. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/models/__init__.py +0 -0
  49. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/models/job.py +0 -0
  50. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/models/step.py +0 -0
  51. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/models/workflow.py +0 -0
  52. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/rule.py +0 -0
  53. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/rules/__init__.py +0 -0
  54. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/rules/check_pr_target.py +0 -0
  55. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/rules/job_environment_prefix.py +0 -0
  56. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/rules/name_capitalized.py +0 -0
  57. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/rules/name_exists.py +0 -0
  58. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/rules/permissions_exist.py +0 -0
  59. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/rules/pinned_job_runner.py +0 -0
  60. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/rules/run_actionlint.py +0 -0
  61. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/rules/step_approved.py +0 -0
  62. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/rules/step_pinned.py +0 -0
  63. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/rules/underscore_outputs.py +0 -0
  64. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/src/bitwarden_workflow_linter/utils.py +0 -0
  65. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/__init__.py +0 -0
  66. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/conftest.py +0 -0
  67. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/fixtures/test-alt.yml +0 -0
  68. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/fixtures/test-min-incorrect.yaml +0 -0
  69. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/fixtures/test-min.yaml +0 -0
  70. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/fixtures/test-outputs-incorrect.yml +0 -0
  71. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/fixtures/test.yml +0 -0
  72. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/fixtures/test_a.yaml +0 -0
  73. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/fixtures/test_workflow.yaml +0 -0
  74. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/fixtures/test_workflow_incorrect.yaml +0 -0
  75. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/rules/__init__.py +0 -0
  76. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/rules/test_check_pr_target.py +0 -0
  77. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/rules/test_job_environment_prefix.py +0 -0
  78. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/rules/test_name_capitalized.py +0 -0
  79. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/rules/test_name_exists.py +0 -0
  80. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/rules/test_permissions_exist.py +0 -0
  81. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/rules/test_pinned_job_runner.py +0 -0
  82. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/rules/test_run_actionlint.py +0 -0
  83. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/rules/test_step_approved.py +0 -0
  84. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/rules/test_step_pinned.py +0 -0
  85. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/rules/test_underscore_output.py +0 -0
  86. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/test_job.py +0 -0
  87. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/test_lint.py +0 -0
  88. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/test_load.py +0 -0
  89. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/test_rule.py +0 -0
  90. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/test_step.py +0 -0
  91. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/test_utils.py +0 -0
  92. {bitwarden_workflow_linter-0.10.0 → bitwarden_workflow_linter-0.10.1}/tests/test_workflow.py +0 -0
@@ -0,0 +1,112 @@
1
+ # Workflow templates are based on starter workflows provided by github at
2
+ # https://github.com/actions/starter-workflows/tree/main and customized to
3
+ # represent common practices used on ACME repositories.
4
+
5
+ # This imaginary workflow runs two steps and illustrates a number of options that we use throughout workflows in the Bitwarden repositories
6
+
7
+ name: Build
8
+
9
+ permissions:
10
+ read-all # Sets permissions of the GITHUB_TOKEN
11
+ # More info: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions
12
+
13
+ on: # Describes when to run the workflow
14
+ # https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
15
+
16
+ workflow_dispatch: # When triggered manually
17
+
18
+ push: # On push to the following branches. Temporarily add a development branch to prompt workflow runs for troubleshooting
19
+ branches: ["main", "rc", "hotfix-rc"]
20
+ paths-ignore: # Updates to these directories or files will not trigger a workflow run
21
+ - ".github/workflows/**"
22
+
23
+ # Pull_request_target: #We strongly discourage using this unless absolutely necessary as it requires access to certain Github secrets.
24
+ # If using this, include the .github/workflows/check-run.yml job and target only the main branch
25
+ # More info at https://github.blog/news-insights/product-news/github-actions-improvements-for-fork-and-pull-request-workflows/#improvements-for-public-repository-forks
26
+
27
+ pull_request: # When a pull request event occurs
28
+ types:
29
+ [
30
+ opened,
31
+ synchronize,
32
+ unlabeled,
33
+ labeled,
34
+ unlabeled,
35
+ reopened,
36
+ edited,
37
+ ]
38
+ branches: ["main"] # Branches where a pull request will trigger the workflow
39
+
40
+ release: # Runs your workflow when release activity in your repository occurs
41
+ types: [published, created]
42
+
43
+ merge_group: # Runs required status checks on merge groups created by merge queue
44
+ types: [checks_requested]
45
+
46
+ repository_dispatch: # Runs when a webook event triggers a workflow from outside of github
47
+ types: [contentful-publish] # Optional, limit repository dispatch events to those in a specified list
48
+
49
+ workflow_call: # Workflow can be called by another workflow
50
+
51
+ env: # Environment variables set for this step but not accessible by all workflows, steps or jobs.
52
+ _AZ_REGISTRY: "ACMEprod.azurecr.io"
53
+ INCREMENTAL: "${{ contains(github.event_name, 'pull_request') && '--sast-incremental' || '' }}"
54
+
55
+ jobs: # A workflow run is made up of one or more jobs that can run sequentially or in parallel
56
+ first-job:
57
+ name: First Job Name
58
+ uses: ./.github/workflows/examples/example-references/_version.yml # Path to an existing github action
59
+ if: github.event.pull_request.draft == false # prevent part of a job from running on a draft PR
60
+ secrets: inherit # When called by another workflow, pass all the calling workflow's secrets to the called workflow
61
+ # "secrets" is only available for a reusable workflow call with "uses"
62
+ strategy: # Create multiple job runs for each of a set of variables
63
+ fail-fast: false # If true, cancel entire run if any job in the matrix fails
64
+ matrix: # Matrix of variables used to define multiple job runs
65
+ include:
66
+ - project_name: Admin
67
+ base_path: ./src
68
+ node: true # Enables steps with if: ${{ matrix.node }}
69
+
70
+ # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
71
+ permissions: # Sets permissions of the GITHUB_TOKEN
72
+ security-events: write # Allow actions to upload results to Github
73
+ id-token: write # Required to fetch an OpenID Connect (OIDC) token
74
+ contents: read # For actions/checkout to fetch code
75
+ deployments: write # Permits an action to create a new deployment
76
+ issues: write # Permits an action to create a new issue
77
+ checks: write # Permits an action to create a check run
78
+ actions: write # Permits an action to cancel a workflow run
79
+ packages: read # Permits an action to access packages on GitHub Packages
80
+ pull-requests: write # Permits an action to add a label to a pull request
81
+
82
+ # steps: when a reusable workflow is called with "uses", "steps" is not available
83
+ second-job:
84
+ name: Second Job Name
85
+ runs-on: ubuntu-22.04 # The type of runner that the job will run on, not available if "uses" is used
86
+ defaults:
87
+ run: # Set the default shell and working directory
88
+ shell: bash
89
+ working-directory: "home/WorkingDirectory"
90
+
91
+ needs:
92
+ - first-job # This job will wait until first-job completes
93
+ # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/setting-a-default-shell-and-working-directory
94
+ steps:
95
+ - name: Descriptive step name
96
+ # 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
+ if: failure() # run when any previous step of a job fails
98
+ # if: '!cancelled()' # run even if previous steps failed
99
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 Always pin a public action version to a full git SHA, followed by the version number in a comment. Version pins are insecure and can introduce vulnerabilities into workflows.
100
+ with: # Parameters specific to this action that need to be defined in order for the step to be completed
101
+ fetch-depth: 0 # Full git history for actions that rely on whether a change has occurred
102
+ ref: ${{ github.event.pull_request.head.sha }}
103
+ creds: ${{ secrets.SECRETS_OR_CREDENTIALS }}
104
+ - name: Another descriptive step name
105
+ # Run a script instead of an existing github action
106
+ run: |
107
+ whoami
108
+ dotnet --info
109
+ node --version
110
+ npm --version
111
+ echo "GitHub ref: $GITHUB_REF"
112
+ echo "GitHub event: $GITHUB_EVENT"
@@ -0,0 +1,131 @@
1
+ # Workflow templates are based on starter workflows provided by github at
2
+ # https://github.com/actions/starter-workflows/tree/main and customized to
3
+ # represent common practices used on Bitwarden repositories.
4
+
5
+ # The Scan Workflow enables you to trigger SAST and quality scans directly
6
+ # From the GitHub workflow.
7
+
8
+ name: Scan
9
+
10
+ permissions:
11
+ read-all # Sets permissions of the GITHUB_TOKEN
12
+ # More info: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions
13
+
14
+ on:
15
+ # Controls when the workflow will run
16
+
17
+ # Can use other triggers such as multiple events, activity types and fiters:
18
+ # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#on
19
+ workflow_dispatch: # When triggered manually
20
+
21
+ push:
22
+ # On push to the following branches. Temporarily add a development
23
+ # branch to prompt workflow runs for troubleshooting
24
+ branches:
25
+ - "main"
26
+ - "rc"
27
+ - "hotfix-rc"
28
+ pull_request_target:
29
+ # When a pull request event occurs. Default is opened or reopened unless
30
+ # otherwise specified, as below:
31
+ types: [opened, synchronize] # Options include labeled, unlabeled, reopened
32
+ branches: "main"
33
+
34
+ # A workflow run is made up of one or more jobs that can run sequentially or in
35
+ # parallel
36
+ jobs:
37
+ # This workflow contains the jobs "check-run", "sast", and "quality"
38
+ # This job is relatively simple and just imports a previously written action
39
+ # to be used in this workflow
40
+ check-run: # You set this value with the name of the job you're describing
41
+ name: Check PR run # Human readable descriptor
42
+ # location and branch of bitwarden-owned action being used
43
+ uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
44
+
45
+ sast:
46
+ # A more complex job that has multiple actions as steps described below
47
+ name: SAST scan
48
+ runs-on: ubuntu-22.04 # The type of runner that the job will run on
49
+ needs: check-run # This job will wait until check-run completes
50
+ permissions: # Sets permissions of the GITHUB_TOKEN
51
+ contents: read # For actions/checkout to fetch code
52
+ pull-requests: write # For github actions to upload feedback to PR
53
+ # For github/codeql-action/upload-sarif to upload SARIF results
54
+ security-events: write
55
+
56
+ # Steps represent a sequence of tasks executed as part of the job
57
+ steps:
58
+ - name: Check out repo
59
+ # Always pin a public action version to a full git SHA.
60
+ # Version pins are insecure and can introduce vulnerabilities
61
+ # into workflows.
62
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
63
+ with:
64
+ # Parameters specific to this action that need to be defined
65
+ # in order for the step to be completed
66
+ ref: ${{ github.event.pull_request.head.sha }}
67
+
68
+ - name: Scan with Checkmarx
69
+ if: github.event.pull_request.draft == false # Prevent step from running on draft PR
70
+ uses: checkmarx/ast-github-action@f0869bd1a37fddc06499a096101e6c900e815d81 # 2.0.36
71
+ # Environment variables set for this step but not accessible by all
72
+ # workflows, steps or jobs
73
+ env:
74
+ INCREMENTAL:
75
+ "${{ contains(github.event_name, 'pull_request') \
76
+ && '--sast-incremental' || '' }}"
77
+ 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 }}
88
+
89
+ - name: Upload Checkmarx results to GitHub
90
+ uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
91
+ with:
92
+ sarif_file: cx_result.sarif
93
+
94
+ quality:
95
+ name: Quality scan
96
+ runs-on: ubuntu-22.04
97
+ needs: check-run
98
+ permissions:
99
+ contents: read
100
+ pull-requests: write
101
+
102
+ steps:
103
+ # Set up whatever resources your environment will need
104
+ # to run workflows on your code
105
+ - name: Set up JDK 17
106
+ uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
107
+ with:
108
+ java-version: 17
109
+ distribution: "zulu"
110
+ # This step checks out a copy of your repository
111
+ - name: Set up .NET
112
+ uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0
113
+ # Install a tool without a Github Action
114
+ - name: Install SonarCloud scanner
115
+ run: dotnet tool install dotnet-sonarscanner -g
116
+
117
+ - name: Scan with SonarCloud
118
+ env:
119
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
120
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121
+ # Additional scripts to run outside of a Github Action
122
+ run: |
123
+ dotnet-sonarscanner begin /k:" \
124
+ ${{ github.repository_owner }}_${{ github.event.repository.name }}" \
125
+ /d:sonar.test.inclusions=test/,bitwarden_license/test/ \
126
+ /d:sonar.exclusions=test/,bitwarden_license/test/ \
127
+ /o:"${{ github.repository_owner }}" \
128
+ /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \
129
+ /d:sonar.host.url="https://sonarcloud.io"
130
+ dotnet build
131
+ dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bitwarden_workflow_linter
3
- Version: 0.10.0
3
+ Version: 0.10.1
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
@@ -17,8 +17,7 @@ enabled_rules:
17
17
  level: warning
18
18
  - id: bitwarden_workflow_linter.rules.check_pr_target.RuleCheckPrTarget
19
19
  level: warning
20
- # Cannot add this in until the rule functionality is merged through to main
21
- # - id: bitwarden_workflow_linter.rules.permissions_exist.RulePermissionsExist
22
- # level: warning
20
+ - id: bitwarden_workflow_linter.rules.permissions_exist.RulePermissionsExist
21
+ level: warning
23
22
 
24
23
  approved_actions_path: default_actions.json
@@ -1,3 +1,3 @@
1
1
  """Metadata for Workflow Linter."""
2
2
 
3
- __version__ = "0.10.0"
3
+ __version__ = "0.10.1"
@@ -17,8 +17,7 @@ enabled_rules:
17
17
  level: warning
18
18
  - id: bitwarden_workflow_linter.rules.check_pr_target.RuleCheckPrTarget
19
19
  level: warning
20
- # Cannot add this in until the rule functionality is merged through to main
21
- # - id: bitwarden_workflow_linter.rules.permissions_exist.RulePermissionsExist
22
- # level: warning
20
+ - id: bitwarden_workflow_linter.rules.permissions_exist.RulePermissionsExist
21
+ level: warning
23
22
 
24
23
  approved_actions_path: default_actions.json
@@ -1,100 +0,0 @@
1
- # Workflow templates are based on starter workflows provided by github at
2
- # https://github.com/actions/starter-workflows/tree/main and customized to
3
- # represent common practices used on ACME repositories.
4
-
5
- # This imaginary workflow runs two steps and illustrates a number of options that we use throughout workflows in the Bitwarden repositories
6
-
7
- name: Build
8
-
9
- on: # Describes when to run the workflow
10
- # https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
11
-
12
- workflow_dispatch: # When triggered manually
13
-
14
- push: # On push to the following branches. Temporarily add a development branch to prompt workflow runs for troubleshooting
15
- branches: ["main", "rc", "hotfix-rc"]
16
- paths-ignore: # Updates to these directories or files will not trigger a workflow run
17
- - ".github/workflows/**"
18
-
19
- # Pull_request_target: #We strongly discourage using this unless absolutely necessary as it requires access to certain Github secrets.
20
- # If using this, include the .github/workflows/check-run.yml job and target only the main branch
21
- # More info at https://github.blog/news-insights/product-news/github-actions-improvements-for-fork-and-pull-request-workflows/#improvements-for-public-repository-forks
22
-
23
- pull_request: # When a pull request event occurs
24
- types: [opened, synchronize, unlabeled, labeled, unlabeled, reopened, edited]
25
- branches: ["main"] # Branches where a pull request will trigger the workflow
26
-
27
-
28
- release: # Runs your workflow when release activity in your repository occurs
29
- types: [published, created]
30
-
31
- merge_group: # Runs required status checks on merge groups created by merge queue
32
- types: [checks_requested]
33
-
34
- repository_dispatch: # Runs when a webook event triggers a workflow from outside of github
35
- types: [contentful-publish] # Optional, limit repository dispatch events to those in a specified list
36
-
37
- workflow_call: # Workflow can be called by another workflow
38
-
39
- env: # Environment variables set for this step but not accessible by all workflows, steps or jobs.
40
- _AZ_REGISTRY: "ACMEprod.azurecr.io"
41
- INCREMENTAL: "${{ contains(github.event_name, 'pull_request') && '--sast-incremental' || '' }}"
42
-
43
- jobs: # A workflow run is made up of one or more jobs that can run sequentially or in parallel
44
- first-job:
45
- name: First Job Name
46
- uses: ./.github/workflows/examples/example-references/_version.yml # Path to an existing github action
47
- if: github.event.pull_request.draft == false # prevent part of a job from running on a draft PR
48
- secrets: inherit # When called by another workflow, pass all the calling workflow's secrets to the called workflow
49
- # "secrets" is only available for a reusable workflow call with "uses"
50
- strategy: # Create multiple job runs for each of a set of variables
51
- fail-fast: false # If true, cancel entire run if any job in the matrix fails
52
- matrix: # Matrix of variables used to define multiple job runs
53
- include:
54
- - project_name: Admin
55
- base_path: ./src
56
- node: true # Enables steps with if: ${{ matrix.node }}
57
-
58
- # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
59
- permissions: # Sets permissions of the GITHUB_TOKEN
60
- security-events: write # Allow actions to upload results to Github
61
- id-token: write # Required to fetch an OpenID Connect (OIDC) token
62
- contents: read # For actions/checkout to fetch code
63
- deployments: write # Permits an action to create a new deployment
64
- issues: write # Permits an action to create a new issue
65
- checks: write # Permits an action to create a check run
66
- actions: write # Permits an action to cancel a workflow run
67
- packages: read # Permits an action to access packages on GitHub Packages
68
- pull-requests: write # Permits an action to add a label to a pull request
69
-
70
- # steps: when a reusable workflow is called with "uses", "steps" is not available
71
- second-job:
72
- name: Second Job Name
73
- runs-on: ubuntu-22.04 # The type of runner that the job will run on, not available if "uses" is used
74
- defaults:
75
- run: # Set the default shell and working directory
76
- shell: bash
77
- working-directory: "home/WorkingDirectory"
78
-
79
- needs:
80
- - first-job # This job will wait until first-job completes
81
- # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/setting-a-default-shell-and-working-directory
82
- steps:
83
- - name: Descriptive step name
84
- # NOT RECOMMENDED if: always() # run even if previous steps failed or the workflow is canceled, this can cause a workflow run to hang indefinitely
85
- if: failure() # run when any previous step of a job fails
86
- # if: '!cancelled()' # run even if previous steps failed
87
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 Always pin a public action version to a full git SHA, followed by the version number in a comment. Version pins are insecure and can introduce vulnerabilities into workflows.
88
- with: # Parameters specific to this action that need to be defined in order for the step to be completed
89
- fetch-depth: 0 # Full git history for actions that rely on whether a change has occurred
90
- ref: ${{ github.event.pull_request.head.sha }}
91
- creds: ${{ secrets.SECRETS_OR_CREDENTIALS }}
92
- - name: Another descriptive step name
93
- # Run a script instead of an existing github action
94
- run: |
95
- whoami
96
- dotnet --info
97
- node --version
98
- npm --version
99
- echo "GitHub ref: $GITHUB_REF"
100
- echo "GitHub event: $GITHUB_EVENT"
@@ -1,126 +0,0 @@
1
- # Workflow templates are based on starter workflows provided by github at
2
- # https://github.com/actions/starter-workflows/tree/main and customized to
3
- # represent common practices used on Bitwarden repositories.
4
-
5
- # The Scan Workflow enables you to trigger SAST and quality scans directly
6
- # From the GitHub workflow.
7
-
8
- name: Scan
9
-
10
- on:
11
- # Controls when the workflow will run
12
-
13
- # Can use other triggers such as multiple events, activity types and fiters:
14
- # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#on
15
- workflow_dispatch: # When triggered manually
16
-
17
- push:
18
- # On push to the following branches. Temporarily add a development
19
- # branch to prompt workflow runs for troubleshooting
20
- branches:
21
- - "main"
22
- - "rc"
23
- - "hotfix-rc"
24
- pull_request_target:
25
- # When a pull request event occurs. Default is opened or reopened unless
26
- # otherwise specified, as below:
27
- types: [opened, synchronize] # Options include labeled, unlabeled, reopened
28
- branches: 'main'
29
-
30
- # A workflow run is made up of one or more jobs that can run sequentially or in
31
- # parallel
32
- jobs:
33
- # This workflow contains the jobs "check-run", "sast", and "quality"
34
- # This job is relatively simple and just imports a previously written action
35
- # to be used in this workflow
36
- check-run: # You set this value with the name of the job you're describing
37
- name: Check PR run # Human readable descriptor
38
- # location and branch of bitwarden-owned action being used
39
- uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
40
-
41
- sast:
42
- # A more complex job that has multiple actions as steps described below
43
- name: SAST scan
44
- runs-on: ubuntu-22.04 # The type of runner that the job will run on
45
- needs: check-run # This job will wait until check-run completes
46
- permissions: # Sets permissions of the GITHUB_TOKEN
47
- contents: read # For actions/checkout to fetch code
48
- pull-requests: write # For github actions to upload feedback to PR
49
- # For github/codeql-action/upload-sarif to upload SARIF results
50
- security-events: write
51
-
52
- # Steps represent a sequence of tasks executed as part of the job
53
- steps:
54
- - name: Check out repo
55
- # Always pin a public action version to a full git SHA.
56
- # Version pins are insecure and can introduce vulnerabilities
57
- # into workflows.
58
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
59
- with:
60
- # Parameters specific to this action that need to be defined
61
- # in order for the step to be completed
62
- ref: ${{ github.event.pull_request.head.sha }}
63
-
64
- - name: Scan with Checkmarx
65
- if: github.event.pull_request.draft == false # Prevent step from running on draft PR
66
- uses: checkmarx/ast-github-action@f0869bd1a37fddc06499a096101e6c900e815d81 # 2.0.36
67
- # Environment variables set for this step but not accessible by all
68
- # workflows, steps or jobs
69
- env:
70
- INCREMENTAL: "${{ contains(github.event_name, 'pull_request') \
71
- && '--sast-incremental' || '' }}"
72
- with:
73
- project_name: ${{ github.repository }}
74
- cx_tenant: ${{ secrets.CHECKMARX_TENANT }}
75
- base_uri: https://ast.checkmarx.net/
76
- cx_client_id: ${{ secrets.CHECKMARX_CLIENT_ID }}
77
- cx_client_secret: ${{ secrets.CHECKMARX_SECRET }}
78
- additional_params: |
79
- --report-format sarif \
80
- --filter \
81
- "state=TO_VERIFY;PROPOSED_NOT_EXPLOITABLE;CONFIRMED;URGENT"\
82
- --output-path . ${{ env.INCREMENTAL }}
83
-
84
- - name: Upload Checkmarx results to GitHub
85
- uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
86
- with:
87
- sarif_file: cx_result.sarif
88
-
89
- quality:
90
- name: Quality scan
91
- runs-on: ubuntu-22.04
92
- needs: check-run
93
- permissions:
94
- contents: read
95
- pull-requests: write
96
-
97
- steps:
98
- # Set up whatever resources your environment will need
99
- # to run workflows on your code
100
- - name: Set up JDK 17
101
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
102
- with:
103
- java-version: 17
104
- distribution: "zulu"
105
- # This step checks out a copy of your repository
106
- - name: Set up .NET
107
- uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0
108
- # Install a tool without a Github Action
109
- - name: Install SonarCloud scanner
110
- run: dotnet tool install dotnet-sonarscanner -g
111
-
112
- - name: Scan with SonarCloud
113
- env:
114
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
115
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116
- # Additional scripts to run outside of a Github Action
117
- run: |
118
- dotnet-sonarscanner begin /k:" \
119
- ${{ github.repository_owner }}_${{ github.event.repository.name }}" \
120
- /d:sonar.test.inclusions=test/,bitwarden_license/test/ \
121
- /d:sonar.exclusions=test/,bitwarden_license/test/ \
122
- /o:"${{ github.repository_owner }}" \
123
- /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \
124
- /d:sonar.host.url="https://sonarcloud.io"
125
- dotnet build
126
- dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"