Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build Check

on:
pull_request:
branches: [main]

Comment thread
coderabbitai[bot] marked this conversation as resolved.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-check:
name: Build Check
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build image (validation only)
uses: docker/build-push-action@v6.15.0
with:
Comment thread
rickyheijnen marked this conversation as resolved.
context: .
push: false
tags: ghcr.io/${{ github.repository }}:pr-check
cache-from: type=gha,scope=image
cache-to: type=gha,mode=max,scope=image
Comment on lines +25 to +32
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

Scope cache per-PR to reduce cross-PR cache poisoning and improve reproducibility.

Using a shared "image" scope across all PRs can cause confusing cache reuse and security concerns. Prefer scoping caches to each PR.

       - name: Build image (validation only)
         uses: docker/build-push-action@v6.15.0
         with:
           context: .
           push: false
           tags: ghcr.io/${{ github.repository }}:pr-check
-          cache-from: type=gha,scope=image
-          cache-to: type=gha,mode=max,scope=image
+          cache-from: type=gha,scope=pr-${{ github.event.pull_request.number }}
+          cache-to: type=gha,mode=max,scope=pr-${{ github.event.pull_request.number }}
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Build image (validation only)
uses: docker/build-push-action@v6.15.0
with:
context: .
push: false
tags: ghcr.io/${{ github.repository }}:pr-check
cache-from: type=gha,scope=image
cache-to: type=gha,mode=max,scope=image
- name: Build image (validation only)
uses: docker/build-push-action@v6.15.0
with:
context: .
push: false
tags: ghcr.io/${{ github.repository }}:pr-check
cache-from: type=gha,scope=pr-${{ github.event.pull_request.number }}
cache-to: type=gha,mode=max,scope=pr-${{ github.event.pull_request.number }}
πŸ€– Prompt for AI Agents
.github/workflows/build-check.yml lines 21-28: the docker build cache is using a
shared scope "image" across PRs which can cause cross-PR cache poisoning; update
the cache scope to be PR-specific (for example use the pull request number or
head ref) for both cache-from and cache-to so each PR gets an isolated cache
(e.g. scope: pr-${{ github.event.pull_request.number }} or scope: pr-${{
github.head_ref }}); ensure the same PR-specific expression is used in both
cache-from and cache-to and consider falling back to run id if the workflow runs
outside a PR.



28 changes: 28 additions & 0 deletions .github/workflows/code-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Code Lint

on:
pull_request:
branches: [main]

Comment thread
coderabbitai[bot] marked this conversation as resolved.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint-dockerfile:
name: Lint Dockerfile
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Lint Dockerfile with hadolint
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ./Dockerfile
config: .hadolint.yaml


4 changes: 4 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-push:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# .hadolint.yaml
ignored:
- DL3007 # Using latest is prone to errors if the image will ever update
- DL3008 # Pin versions in apt get install
- DL3013 # Pin versions in pip install
- DL3016 # Pin versions in npm install
Comment thread
rickyheijnen marked this conversation as resolved.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ FROM ghcr.io/actions/actions-runner:latest

USER root

# Set shell with pipefail for better error handling
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Update and install base dependencies
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt update \
&& apt install -y --no-install-recommends \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
# System build tools
Comment thread
rickyheijnen marked this conversation as resolved.
autoconf \
automake \
Expand Down Expand Up @@ -37,7 +40,7 @@ RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
zip \
# Linters/Formatters
yamllint \
&& apt clean \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install AWS CLI
Expand Down