Skip to content

Add GitHub Action

Add GitHub Action #11

name: Endor Labs PR Scan
on:
pull_request:
branches:
- 'master'
- 'releases/v*'
- 'debian/*'
paths:
- '**/CMakeLists.txt'
- '**/*.cmake'
jobs:
endor_pr_scan:
permissions:
id-token: write # Required to request a json web token (JWT) for keyless authentication with Endor Labs
pull-requests: write # Required for endorctl to write pr comments
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
fetch-tags: true
submodules: recursive
- name: Configure CMake and fetch dependency sources
env:
BUILD_TYPE: Release
BUILD: ${{github.workspace}}/build
CXX_STANDARD: 17
working-directory: ${{env.BUILD}}
run: |
cmake .. -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_STANDARD=${{env.CXX_STANDARD}} -DENABLE_TESTS=ON
git add build/_deps
git commit -m "Add build/_deps"
- name: Endor Labs - Pull Request Scan
uses: endorlabs/github-action@519df81de5f68536c84ae05ebb2986d0bb1d19fc # v1.1.8
with:
additional_args: "--languages=c"
enable_pr_comments: true
github_token: ${{ secrets.GITHUB_TOKEN }} # Required for endorctl to write pr comments
log_level: info
log_verbose: false
namespace: mongodb.${{github.repository_owner}}
pr: true
scan_dependencies: true
scan_path: build/_deps
scan_summary_output_type: "table"
tags: github_action
env:
ENDOR_SCAN_EMBEDDINGS: true