Skip to content

Commit

Permalink
feat: add hadolint report to PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Qlebrun committed Aug 14, 2024
1 parent d45bde3 commit bbfaed3
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/dockerfile-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,27 @@ jobs:
- name: Checkout
uses: actions/checkout@v4


- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ${{ inputs.dockerfile_path }}
output-file: test-report.json
format: json

- 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
})

0 comments on commit bbfaed3

Please sign in to comment.