github-action-markdown-link-check icon indicating copy to clipboard operation
github-action-markdown-link-check copied to clipboard

WIP: Added results as output parameters

Open gaurav-nelson opened this issue 3 years ago • 4 comments

Changes for #9

Based on:

  • https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
  • https://trstringer.com/github-actions-multiline-strings/

gaurav-nelson avatar Aug 09 '22 08:08 gaurav-nelson

@gaurav-nelson What's your thinking on this work?

I was thinking that perhaps we could implement this feature by adding an action input to decide whether to set the output from mlc as an action output or as a file. This could default to output only to console as it stands now.

The reason I'm suggesting this is because sometimes the output from mlc might exceed the maximum value for a step output. If the user finds himself in that situation he can switch to use a file output and still get a hold of the results on the next step of the workflow.

Or perhaps as a first version you just allow outputting to a file since that will always work. When comparing with outputting to a file, setting the mlc output as an action output is more for convenience than anything else.

Also, if you consider outputting to a file you can just have a default filepath but you can also allow the user to select the filepath as another action input parameter

edumserrano avatar Sep 04 '22 12:09 edumserrano

Hi @gaurav-nelson, any thoughts on the above comment?

edumserrano avatar Sep 30 '22 23:09 edumserrano

Hi @gaurav-nelson, In case you missed it, GitHub has updated the way the output is set. See GitHub Actions: Deprecating save-state and set-output commands.

The official docs have been updated as well: Setting an output parameter.

Furthermore, this change on GitHub means we don't have to worry anymore with encoding multi-line output values. So some things that you have in this branch that are like the below aren't needed anymore:

MLC_OUTPUT="${MLC_OUTPUT//'%'/'%25'}"
MLC_OUTPUT="${MLC_OUTPUT//$'\n'/'%0A'}"
MLC_OUTPUT="${MLC_OUTPUT//$'\r'/'%0D'}"

The change should be very straightforward from what you have to the new API. Hope this helps. Any thoughts on when we could have this merged?

edumserrano avatar Mar 08 '23 14:03 edumserrano

Looking forward to this.

tyler36 avatar Jun 27 '23 07:06 tyler36

Hi @gaurav-nelson, are there any plans to get this merged in? We find your workflow very useful, and I'd love to see an output of the results (i.e. failures if any are detected), as oppose to having to sift through all of the results for the broken link. Thanks!

moonbox3 avatar Mar 05 '24 18:03 moonbox3

Thank you everyone for chipping in. I'll try to get this in.

gaurav-nelson avatar Mar 14 '24 07:03 gaurav-nelson

Thank you all. You can use this using the SHA as described at https://github.com/gaurav-nelson/github-action-markdown-link-check?tab=readme-ov-file#versioning

- uses: gaurav-nelson/github-action-markdown-link-check@25b2c436c653f0d4500d3c2df86e5c14e71e44e1

gaurav-nelson avatar Mar 14 '24 07:03 gaurav-nelson