-
Notifications
You must be signed in to change notification settings - Fork 0
π· Add lint and buid-check workflow #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||||||||||||||||||||||||||||||
| name: Build Check | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| 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: | ||||||||||||||||||||||||||||||||||
|
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
π€ Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: Code Lint | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
|
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 | ||
|
|
||
|
|
||
| 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 | ||
|
rickyheijnen marked this conversation as resolved.
|
||
Uh oh!
There was an error while loading. Please reload this page.