Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,22 @@
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

name: "CLA Assistant"

on:
issue_comment:
types: [created, edited]
pull_request_target:
types: [opened, closed, synchronize]

# Recommended permissions scoping for CLA Assistant
permissions:
contents: read
actions: write
pull-requests: write
statuses: write

jobs:
CLAssistant:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -49,7 +58,7 @@ jobs:

- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
uses: contributor-assistant/github-action@v2.2.1
uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # ratchet:contributor-assistant/github-action@v2.6.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.REPO_SCOPE }}
Expand All @@ -59,4 +68,4 @@ jobs:
branch: "main"
remote-organization-name: SpecterOps
remote-repository-name: CLA
allowlist: ${{ steps.org-members.outputs.org_members }}
allowlist: ${{ steps.org-members.outputs.org_members }},dependabot[bot]
75 changes: 75 additions & 0 deletions .github/workflows/conventional-commits.yml
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
Comment thread
wes-mil marked this conversation as resolved.
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
54 changes: 54 additions & 0 deletions .github/workflows/go-test.yml
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 ./...
54 changes: 54 additions & 0 deletions .github/workflows/license-check.yml
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
53 changes: 53 additions & 0 deletions .github/workflows/static-code-analysis.yml
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 ./...
72 changes: 72 additions & 0 deletions .github/workflows/vulnerability-scans.yml
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
Comment thread
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"
Loading
Loading