So I’ve created a github action that is Docker based and using the new(ish) problem matcher to handle some output from Rubocop. The problem I have is that the command doesn’t seem to be able to find the problem matcher json file yet it’s inside the container.
The action is here: https://github.com/rewindio/github-action-rubocop
It is very straightforward:
Simple docker image that runs a shell script (entrypoint.sh):
RUN gem install rubocop --no-document COPY entrypoint.sh /entrypoint.sh COPY rubocop-problem-matcher.json /rubocop-problem-matcher.json ENTRYPOINT ["/entrypoint.sh"]
The command in the entrypoint script then is just:
The file must be there because the entrypoint file is and it’s invoked. However, when the action runs, it fails with:
Running Rubocop... ::add-matcher::/rubocop-problem-matcher.json ##[error]Unable to process command '::add-matcher::/rubocop-problem-matcher.json' successfully. ##[error]Could not find file '/rubocop-problem-matcher.json'.
Is there something different about using problem matchers in containers? Alas, all of the examples (setup-node, setup-python) are JS actions which are not Docker based. I feel I’m missing something about how it’s trying to locate the file when it’s container based.