From 1b4ecb116699bde5d43bb1006fee3056219d0f35 Mon Sep 17 00:00:00 2001 From: Mike Jensen Date: Wed, 13 Mar 2024 09:16:45 -0600 Subject: [PATCH 1/2] Add `dependency-review` PR check This job will help validate that we are not adding any vulnerable dependencies. --- .github/workflows/dependency-review.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/dependency-review.yaml diff --git a/.github/workflows/dependency-review.yaml b/.github/workflows/dependency-review.yaml new file mode 100644 index 0000000..5eb64ee --- /dev/null +++ b/.github/workflows/dependency-review.yaml @@ -0,0 +1,10 @@ +name: Dependency Review + +on: + pull_request: + +jobs: + dependency-review: + uses: gravitational/shared-workflows/.github/workflows/dependency-review.yaml@main + permissions: + contents: read From 39302e6e6f3ded3833585d170a6927c41120acb3 Mon Sep 17 00:00:00 2001 From: Mike Jensen Date: Wed, 13 Mar 2024 09:19:01 -0600 Subject: [PATCH 2/2] Add CodeQL job for PR's and merges into `main` This will provide static analysis of the go code. Helping look for possible bugs or security risks. --- .github/workflows/codeql.yml | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..a82917a --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,47 @@ +name: "CodeQL" + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'go' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Set up Go + uses: actions/setup-go@v5 + with: + cache: false + go-version-file: go.mod + if: ${{ matrix.language == 'go' }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}"