Skip to content

Add workflow to lint Dockerfile using hadolint #1

Add workflow to lint Dockerfile using hadolint

Add workflow to lint Dockerfile using hadolint #1

name: ci:lint-dockerfile
on:
push:
branches:
- main
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
name: Continuous integration (lint dockerfile)
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Lint workflows 👕
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ./Dockerfile
- name: Annotate PR 📣
uses: actions/github-script@v6
if: github.event_name == 'pull_request'
with:

Check failure on line 32 in .github/workflows/ci:lint-dockerfile.yml

View workflow run for this annotation

GitHub Actions / ci:lint-dockerfile

Invalid workflow file

The workflow is not valid. .github/workflows/ci:lint-dockerfile.yml (Line: 32, Col: 14): Unexpected value '' .github/workflows/ci:lint-dockerfile.yml (Line: 33, Col: 9): Unexpected value 'script'
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
})