redis/.github/workflows/codeql-analysis.yml
Cong Chen 13d9553673
Add concurrency groups to cancel stale GH workflow runs (#15224)
This is based on
[valkey-io/valkey#849](https://github.com/valkey-io/valkey/pull/849)

Introduce `concurrency` and `group` keywords into workflows execpt from
`redis_docs_sync` (which is triggered on release event only) and
`daily`.

https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency

With this, only one workflow can run in a group at any time.

---------

Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
2026-05-26 08:54:39 +08:00

37 lines
852 B
YAML

name: "CodeQL"
on:
pull_request:
schedule:
# run weekly new vulnerability was added to the database
- cron: '0 0 * * 0'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
if: github.event_name != 'schedule' || github.repository == 'redis/redis'
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4