Skip to content

Commit

Permalink
Merge pull request #141 from ZeroGachis/feature/add_linter_artifact
Browse files Browse the repository at this point in the history
feat: add hadolint report to PR comment
  • Loading branch information
Qlebrun authored Aug 14, 2024
2 parents d45bde3 + bbfaed3 commit bc6c8dc
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/[email protected]
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 bc6c8dc

Please sign in to comment.