-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
"add-matcher" doesn't work from within a Docker container #305
Comments
I had exactly the same problem when I was putting together an action for Rubocop (https://github.com/rewindio/github-action-rubocop). I ended up having to copy the matcher json to the host in my script:
It works but feels a bit hacky. Would sure be nice if the matcher could be read inside the container. |
@dnorth98 thank you so much for this tip. I was banging my head against the wall trying every configuration I could think of to get it to find the file. It would be better not to hack it, and I'm happy to just have the action working for now. |
$RUNNER_TEMP should also work. Basically it has to be copied to one of the mapped directories since the runner is running on the host. |
Updated docs too early #341 with the guidance: cp /eslint-compact.json "$HOME/"
echo "::add-matcher::$HOME/eslint-compact.json However, bug in the runner preventing that from working. Fixed the bug just now actions/runner#331 . After the new runner rolls out (sometime over next couple weeks), will restore guidance in docs. |
Been a while, but I finally got to testing the |
It uses the solution mentioned in actions/toolkit#305 (comment)
Describe the bug
#56 (comment) suggests that "add-matcher" works from within a Docker container. I couldn't find a way to get this to work. "add-matcher" always uses the host file-system to lookup the file, and can't read a file from the Docker container (that I could find).
To Reproduce
See https://github.com/TrueBrain/actions-flake8/blob/initial_work/entrypoint.sh#L5.
Removing the
cp
on line 4 and useflake8-matcher.json
instead of the full path on line 5. This will result in a "file not found" error.Expected behavior
"add-matcher" to work from within a Docker container.
Additional context
Honestly, I can fully understand that "add-matcher" uses the host file-system. So maybe this is not a bug or unexpected.
The main thing that is puzzling me a bit, is that the comment linked suggests it should work. But I couldn't find any example of this, and the documentation doesn't talk about this. So I am not sure. As a result: this ticket, in the hope one of you can shed some light on this topic :)
If the
cp
is the expected solution, I would love to get some pointers what a good folder is to copy this to. Using the workflow folder for this feels a bit ugly.Or possibly my solution is just completely bananas, and you have a much better solution in mind.
Tnx!
The text was updated successfully, but these errors were encountered: