Skip to content
Open
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
64 changes: 64 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Lint
on:
pull_request:
paths:
- '**/Dockerfile'

jobs:
prepare:
name: Generate matrix
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v38
with:
json: true
escapepath: false
files: |
**/Dockerfile

- id: set-matrix
run: echo "matrix={\"dockerfile\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT"

hadolint:
name: Hadolint
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJson(needs.prepare.outputs.matrix)}}

steps:
- uses: actions/checkout@v4
- uses: hadolint/hadolint-action@v3.1.0
id: hadolint
continue-on-error: true
with:
verbose: true
dockerfile: ${{matrix.dockerfile}}

- name: Update Pull Request
uses: actions/github-script@v6
if: github.event_name == 'pull_request'
with:
script: |
const output = `
#### Hadolint: \`${{ steps.hadolint.outcome }}\`
\`\`\`
${process.env.HADOLINT_RESULTS}
\`\`\`
`;

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
2 changes: 2 additions & 0 deletions images/kube-proxy/v1.28.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# dummy change to trigger workflow

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I get this is only for testing the workflow added in this PR, but that will also trigger a rebuild when this PR gets merged, overwriting the already built tag in the registry. We need to remove that before merging.


FROM docker.io/library/golang:1.20.8-alpine3.18 as binary

RUN apk add --no-cache cmd:make cmd:bash cmd:rsync
Expand Down