-
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):
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:
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. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 entrypoint.sh file:
(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. |
Beta Was this translation helpful? Give feedback.
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 entrypoint.sh file:
(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 ba…