From 4797b2c7943b935b7573d29616b6f015faa46dfa Mon Sep 17 00:00:00 2001 From: AnzalKhan16 Date: Wed, 1 Jul 2026 16:54:58 +0530 Subject: [PATCH 1/2] feat(ci): add GitHub CodeQL security scanning workflow --- .github/workflows/codeql.yml | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 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..4abbe59 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,52 @@ +name: CodeQL Security Scan + +on: + push: + branches: + - main + + pull_request: + branches: + - main + + workflow_dispatch: + +permissions: + actions: read + contents: read + security-events: write + +env: + GO_VERSION: "1.25" + +jobs: + analyze: + name: Analyze Go Code + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: + - go + + steps: + - name: Checkout Repository + uses: actions/checkout@v6 + + - name: Setup Go + uses: actions/setup-go@v6 + with: + go-version: ${{ env.GO_VERSION }} + cache: true + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + + - name: Build Project + run: make build + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 \ No newline at end of file From 382940b09a2fc20543af4f2f97ae4a9b98c9d534 Mon Sep 17 00:00:00 2001 From: AnzalKhan16 Date: Wed, 1 Jul 2026 16:57:07 +0530 Subject: [PATCH 2/2] feat(ci): add GitHub CodeQL security scanning workflow --- .github/workflows/codeql.yml | 38 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 4abbe59..883f18a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,19 +2,14 @@ name: CodeQL Security Scan on: push: - branches: - - main - + branches: [main] pull_request: - branches: - - main - + branches: [main] workflow_dispatch: -permissions: - actions: read - contents: read - security-events: write +concurrency: + group: codeql-${{ github.ref }} + cancel-in-progress: true env: GO_VERSION: "1.25" @@ -24,29 +19,28 @@ jobs: name: Analyze Go Code runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + strategy: fail-fast: false matrix: - language: - - go + language: [go] steps: - - name: Checkout Repository - uses: actions/checkout@v6 + - uses: actions/checkout@v6 - - name: Setup Go - uses: actions/setup-go@v6 + - uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} cache: true - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + - uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - - name: Build Project - run: make build + - uses: github/codeql-action/autobuild@v3 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 \ No newline at end of file + - uses: github/codeql-action/analyze@v3 \ No newline at end of file