Toolkit: Add Problem matcher docs

Created on 14 Aug 2019  路  10Comments  路  Source: actions/toolkit

Would be helpful to have a schema/explanation of what matchers actually do.

documentation

Most helpful comment

The problem I am having with using Docker for this, that I first need to copy the ProblemMatcher file to the host system:

https://github.com/TrueBrain/actions-flake8/blob/initial_work/entrypoint.sh#L5

I am not sure if this is intended, but every other way resulted in errors. It seems add-matcher uses the host filesystem (which makes sense). But your comments here suggests it should work from within a Docker. Do you have an example how you tested that it worked (so I can cheat from it :D)? Or is my solution the way to go?

All 10 comments

I added one of these to my action and it was working ok, but when I switched it over to run in a Docker container the run started to fail saying the file couldn't be found (I've confirmed it is in the container). Do these not work in Docker containers or is there more to get them working?

I used this as my format guide since they seemed to be the same, or close enough that things still worked https://code.visualstudio.com/Docs/editor/tasks#_defining-a-problem-matcher

@ericsciple is there any reason problem matchers wouldn't work in a docker container? I'm not aware of any, but he would know better

@damccorm I got it working. I switched from ## to :: as per #59 and that fixed it. Both syntaxes worked in script style actions, but container based ones seem to only support ::.


I take that back. The :: syntax doesn't get picked up for problem matchers which is why it wasn't failing. I also realized that I can use core.error() and get the same results so that's what I'm going with now.

We should cover that these will create annotations, and how else users can create annotations using issues on the toolkit docs!

@thboop as per my comments above I was unable to use problem matchers in a docker based action. Should that be possible or can you only use problem matchers in javascript based actions?

@xt0rted, problem matchers should work in actions running in docker. I'll take a look shortly and create a ticket if I'm able to reproduce the issue. Otherwise, do you have an example you can link?

@thboop after I couldn't get it to work I switched to using log commands since it achieved the same thing.

@thboop after I couldn't get it to work I switched to using log commands since it achieved the same thing.
@xt0rted sorry for the delay!
We did recently fix a bug where the workspace of actions running in a container was getting set incorrectly (which may have prevented you from registering a problem matcher as it would not be able to locate the file correctly). That being said, Problem Matchers appear to be working fine in containers for me! Please file an issue if you run into the problem again!

The problem I am having with using Docker for this, that I first need to copy the ProblemMatcher file to the host system:

https://github.com/TrueBrain/actions-flake8/blob/initial_work/entrypoint.sh#L5

I am not sure if this is intended, but every other way resulted in errors. It seems add-matcher uses the host filesystem (which makes sense). But your comments here suggests it should work from within a Docker. Do you have an example how you tested that it worked (so I can cheat from it :D)? Or is my solution the way to go?

@TrueBrain I hit the same issue. Your workaround for docker based images worked for me as well.

Was this page helpful?
0 / 5 - 0 ratings