Skip to content

Commit 1115e7d

Browse files
julian-rischclaude
andauthored
ci: pin more dependencies and configure CodeQL checks (#11777)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a0c0e9c commit 1115e7d

6 files changed

Lines changed: 72 additions & 10 deletions

File tree

.github/dependabot.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ updates:
2222
default-days: 1
2323

2424
# Tracks the digest-pinned `COPY --from` image (ghcr.io/astral-sh/uv) in
25-
# docker/Dockerfile.base. Note: the python:3.12-slim base/builder images are
26-
# passed via build args from docker/docker-bake.hcl and the `docker run` image
27-
# strings in workflows are not parsed by Dependabot; bump those manually.
25+
# docker/Dockerfile.base. Note: the python:3.12-slim base/builder digests are
26+
# carried both as the build_image/base_image ARG defaults in Dockerfile.base
27+
# and in docker/docker-bake.hcl (which overrides them at build time).
28+
# Dependabot does NOT parse images that reach FROM via an ARG, nor the
29+
# `docker run` image strings in workflows, so bump those by hand and keep the
30+
# Dockerfile.base ARG defaults and docker-bake.hcl digests in sync.
2831
- package-ecosystem: 'docker'
2932
directory: '/docker'
3033
schedule:

.github/workflows/codeql.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
# Cancel a superseded run for the same ref (e.g. a force-push to a PR) so we
14+
# don't burn CI minutes analyzing commits that are already stale.
15+
concurrency:
16+
group: codeql-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
analyze:
21+
name: Analyze (${{ matrix.language }})
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 360
24+
permissions:
25+
# Required to upload code-scanning results to the Security tab.
26+
security-events: write
27+
# Required by codeql-action to read the workflow/CI config.
28+
actions: read
29+
contents: read
30+
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
include:
35+
# Haystack is a Python project; Python is interpreted, so no build is
36+
# needed. Add `javascript-typescript` here if the docs-website JS code
37+
# should also be scanned.
38+
- language: python
39+
build-mode: none
40+
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
44+
with:
45+
persist-credentials: false
46+
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/init@dd903d2e4f5405488e5ef1422510ee31c8b32357 # v3.36.2
49+
with:
50+
languages: ${{ matrix.language }}
51+
build-mode: ${{ matrix.build-mode }}
52+
53+
- name: Perform CodeQL Analysis
54+
uses: github/codeql-action/analyze@dd903d2e4f5405488e5ef1422510ee31c8b32357 # v3.36.2
55+
with:
56+
category: "/language:${{ matrix.language }}"

.github/workflows/docs_search_sync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install Docusaurus and build docs-website
3737
working-directory: docs-website
3838
run: |
39-
npm install --ignore-scripts
39+
npm ci --ignore-scripts
4040
npm rebuild sharp
4141
npm run build
4242

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ jobs:
6161
retention-days: 5
6262

6363
- name: Upload to code-scanning
64-
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
64+
uses: github/codeql-action/upload-sarif@dd903d2e4f5405488e5ef1422510ee31c8b32357 # v3.36.2
6565
with:
6666
sarif_file: results.sarif

.github/workflows/workflows_linting.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
go-version: ">=1.24.0"
2323

2424
- name: Install actionlint
25-
run: go install github.com/rhysd/actionlint/cmd/actionlint@latest
25+
run: go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.12
2626

2727
- name: Run actionlint
2828
env:

docker/Dockerfile.base

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
ARG build_image
2-
ARG base_image
1+
# Pinned digest defaults so the base images are resolvable by hash even when
2+
# the args are not passed (e.g. by supply-chain scanners or a plain `docker build`).
3+
# docker/docker-bake.hcl overrides these at build time; keep the digests in sync.
4+
ARG build_image=python:3.12-slim@sha256:090ba77e2958f6af52a5341f788b50b032dd4ca28377d2893dcf1ecbdfdfe203
5+
ARG base_image=python:3.12-slim@sha256:090ba77e2958f6af52a5341f788b50b032dd4ca28377d2893dcf1ecbdfdfe203
36

4-
FROM $build_image AS build-image
7+
FROM ${build_image} AS build-image
58

69
ARG DEBIAN_FRONTEND=noninteractive
710
ARG haystack_version
@@ -25,7 +28,7 @@ ENV PATH="/opt/venv/bin:$PATH"
2528
RUN uv pip install --no-cache-dir -U setuptools && \
2629
uv pip install --no-cache-dir .
2730

28-
FROM $base_image AS final
31+
FROM ${base_image} AS final
2932

3033
COPY --from=build-image /opt/venv /opt/venv
3134

0 commit comments

Comments
 (0)