lighthouse-action icon indicating copy to clipboard operation
lighthouse-action copied to clipboard

Output result to Slack

Open marcuslindblom opened this issue 6 years ago • 6 comments

Is it possible to get the output from the audit and forward it to e.g Slack?

marcuslindblom avatar Oct 01 '19 06:10 marcuslindblom

Hi there, apologies for the late response!

I don't have much experience with Slack and its API so it might be best to use an existing action for that, there seem to be quite a few:

  • https://github.com/marketplace/actions/slack-bot-action
  • https://github.com/marketplace/actions/post-slack-message
  • https://github.com/marketplace/actions/github-action-for-slack
  • https://github.com/marketplace?utf8=%E2%9C%93&type=actions&query=slack

...and then set the message using steps.<step id>.outputs according to the docs here. I have no idea if this would actually work but I can play around with this when I get a chance in the next few days.

Thanks for your patience!

jakejarvis avatar Oct 13 '19 14:10 jakejarvis

Ok, thanks! Is steps.<step id>.outputs the complete message that is printed in stdout?

marcuslindblom avatar Oct 14 '19 06:10 marcuslindblom

I don't think outputs has anything defined, looking at the entrypoint.sh. That script would have to return something for it work, pretty sure. @jakejarvis this is what #16 is all about. I don't know how to add that with a Dockerfile surrounding the script, but it should be a line or two of change I think.

dgattey avatar Jan 18 '20 02:01 dgattey

@dgattey @marcuslindblom Started working on it. Seems like Github Actions is smart enough to look into the docker output :) #19

@jakejarvis What do you think - shall we add an example on the README for Slack messages in order to close this issue, or is the updated README sufficient?

BrunnerLivio avatar Feb 02 '20 21:02 BrunnerLivio

@BrunnerLivio I can't get the example to work. Do I need an updated version of the action?

marcuslindblom avatar Feb 04 '20 15:02 marcuslindblom

Oh, I can see in the PR that you made some changes. My bad

marcuslindblom avatar Feb 04 '20 15:02 marcuslindblom