problem matcher not found in Docker action

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:

It is very straightforward:

Simple docker image that runs a shell script (

RUN gem install rubocop --no-document


COPY rubocop-problem-matcher.json /rubocop-problem-matcher.json


The command in the entrypoint script then is just:

echo "::add-matcher::/rubocop-problem-matcher.json"

The file must be there because the entrypoint file is and it’s invoked.  However, when the action runs, it fails with:

Running Rubocop...
##[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.

Just solved this.  It’s not obvious but the matcher config json must be available OUTSIDE the action container.  What I ended up doing was copying it into the current workspace. So in my file:


cp /rubocop-problem-matcher.json "$matcher_path"

echo "::add-matcher::rubocop-problem-matcher.json"

(needs a bit of a cleanup).  The key thing is that the workspace path is mapped in the docker container so when you echo the add-matcher command, you cannot use the full path of the file (since that is inside the container).

But…it works!  Have to say, problem matchers are BRILLIANT and vastly simplify the process of getting annotations back to pull requests.