Skip to content
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

Fix Configuration File and 'problem-matcher' Pathing Issue #59

Closed
wants to merge 1 commit into from

Conversation

kgrv-me
Copy link

@kgrv-me kgrv-me commented May 14, 2022

Please refer to #58 for details of the issue(s).

SOLUTIONS

  • Forked to test out the following fix in Dockerfile:
# Set essential environment variables in the container
ENV HOME /github/workspace
ENV PWD /github/workspace

# Set default WORKDIR in Dockerfile for easier trace and consistency
WORKDIR /github/workspace

It seems a bit crude to hardcode, it would lock-in that variable. However, I noticed the repository relies on GitHub environment; this would be just a-okay :D

  • OR set the environment variables in hadolint.sh for more dynamic approach:
# Set essential environment variables in the container
export {PWD,HOME}=$(pwd)
  • Prepending inputs.config with a little bit of editing:
HADOLINT_CONFIG="-c ${PWD}/${HADOLINT_CONFIG}"
  1. Not supplying inputs.config with .hadolint.yaml present works now! (it defaults back to hadolint configuration file places INVESTIGATION.0)
- uses: kgrv-me/hadolint-action@fix/PathingIssue
  1. Supply hadolint.yaml to inputs.config also works! (hadolint won't pick up hadolint.yaml by default)
- uses: kgrv-me/hadolint-action@fix/PathingIssue
  with:
    config: hadolint.yaml

EXTRA ISSUE NOTED

/github/workspace seems intended to be default HOME in hadolint.sh for problem-matcher.json.
However, problem-matcher.json never made it ouside the container into the repository as intended due to HOME=/root (INVESTIGATION.6)

Fixing this ticket (pathing issue) via the above methods
would resolve `problem-matcher.json` condition as well!

Cheers!

@lorenzo
Copy link
Member

lorenzo commented Nov 11, 2022

sorry for the late update. Is it possible for you to add a test to the test suite to make sure this actually works?

@lorenzo lorenzo closed this Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants