-
Notifications
You must be signed in to change notification settings - Fork 0
chore: add github workflows to parity BHCE checks #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
512de8f
add github workflows
wes-mil bfade87
add license tool
wes-mil bcdc569
update conventional commits
wes-mil b3a0342
fail builds on vuln
wes-mil 95a4495
update deps
wes-mil bf0e3d5
update go
wes-mil d8eb690
update packages
wes-mil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # Copyright 2026 Specter Ops, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: Conventional Commit Formatting | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - "stage/**" | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - edited | ||
|
|
||
| jobs: | ||
| conventional-commit-check: | ||
| name: Check conventional commit formatting | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - name: Validate pull request title | ||
| uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # ratchet:amannn/action-semantic-pull-request@v6 | ||
| id: lint_pr_title | ||
| with: | ||
| types: | | ||
| feat | ||
| fix | ||
| docs | ||
| refactor | ||
| test | ||
| chore | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Explain invalid pull request title | ||
| uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # ratchet:marocchino/sticky-pull-request-comment@v2 | ||
| if: always() && (steps.lint_pr_title.outputs.error_message != null) | ||
| with: | ||
| header: pr-title-lint-error | ||
| message: | | ||
| Howdy! Thank you for opening this pull request 🙇 | ||
|
|
||
| It looks like your pull request title needs some adjustment. | ||
| We require pull request titles to follow the Conventional Commits specification as outlined in our [documentation](https://github.com/SpecterOps/BloodHound/blob/main/rfc/bh-rfc-2.md). | ||
| Please review the required format and update your pull request title accordingly. | ||
| Thank you! | ||
|
|
||
| Details: | ||
|
|
||
| ``` | ||
| ${{ steps.lint_pr_title.outputs.error_message }} | ||
| ``` | ||
|
|
||
| - name: Remove resolved pull request title comment | ||
| if: ${{ steps.lint_pr_title.outputs.error_message == null }} | ||
| uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # ratchet:marocchino/sticky-pull-request-comment@v2 | ||
| with: | ||
| header: pr-title-lint-error | ||
| delete: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Copyright 2026 Specter Ops, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: Run Go Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - "stage/**" | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: go-tests-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Execute Go Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout source code for this repository | ||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # ratchet:actions/checkout@v5 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Install Go | ||
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # ratchet:actions/setup-go@v5 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
| check-latest: true | ||
|
|
||
| - name: Run Tests | ||
| run: go test ./... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Copyright 2026 Specter Ops, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: License Check | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - "stage/**" | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: license-check-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| check: | ||
| name: Check License Headers | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout source code for this repository | ||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # ratchet:actions/checkout@v5 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Install Go | ||
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # ratchet:actions/setup-go@v5 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
| check-latest: true | ||
|
|
||
| - name: Check License Headers | ||
| run: go tool license -check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Copyright 2026 Specter Ops, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: Static Code Analysis | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - "stage/**" | ||
| types: | ||
| - opened | ||
| - synchronize | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: static-code-analysis-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| run-analysis: | ||
| name: Run Go Static Analysis | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout source code for this repository | ||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # ratchet:actions/checkout@v5 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Install Go | ||
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # ratchet:actions/setup-go@v5 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
| check-latest: true | ||
|
|
||
| - name: Run Analysis | ||
| run: go tool golangci-lint run --config .golangci.json ./... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # Copyright 2026 Specter Ops, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: Vulnerability Scan | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - "stage/**" | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: vulnerability-scan-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| scan-sbom-file: | ||
| name: Generate and Scan Go SBOM | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout source code for this repository | ||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # ratchet:actions/checkout@v5 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Download Syft CLI | ||
| id: download-syft-cmd | ||
| uses: anchore/sbom-action/download-syft@e22c389904149dbc22b58101806040fa8d37a610 # ratchet:anchore/sbom-action/download-syft@v0.24.0 | ||
|
|
||
| - name: Generate SPDX SBOM | ||
| run: | | ||
| ${{ steps.download-syft-cmd.outputs.cmd }} scan \ | ||
| dir:. \ | ||
| -o spdx-json=./"${{ github.event.repository.name }}-go-sbom.spdx.json" \ | ||
| --select-catalogers go | ||
|
|
||
| - name: Run Dependency Scan | ||
| uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # ratchet:anchore/scan-action@v7.4.0 | ||
| with: | ||
| sbom: "${{ github.event.repository.name }}-go-sbom.spdx.json" | ||
| by-cve: true | ||
| severity-cutoff: high | ||
| only-fixed: true | ||
| output-format: table | ||
| fail-build: true | ||
|
|
||
| - name: Upload SBOM Artifact | ||
| if: ${{ !cancelled() }} | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # ratchet:actions/upload-artifact@v7 | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| with: | ||
| name: "${{ github.event.repository.name }}-go-sbom.spdx.json" | ||
| path: "${{ github.event.repository.name }}-go-sbom.spdx.json" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.