filiph / linkcheck

Fast link checker
https://pub.dartlang.org/packages/linkcheck
MIT License
403 stars 51 forks source link

github actions: Unable to pass -e #72

Closed liskin closed 3 years ago

liskin commented 3 years ago

It's not possible to pass both -e and a URI as arguments when using this as a github actions, as https://github.com/filiph/linkcheck/blob/5090e8c7080c17056e12e318b5c546c53849dc75/action.yml#L16 passes it all as a single argument with spaces. Unfortunately https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsargs looks like this can't be done easily. :-/

I worked it around by forking and adding the flag manually, but that's a terrible hack: https://github.com/liskin/linkcheck/commit/2d34f2f6ab3c7553a319081064ae2b2619744777

filiph commented 3 years ago

Damn. One of these days I'll take a closer look at GitHub Actions. I'm guessing the best way would be to maintain the list of options in action.yml?

To be clear, I won't have time to actively look into this in the foreseeable future. If there's anyone out there who has the time & motivation to fix it, please send a PR.

TriplEight commented 3 years ago

Just faced the same thing, can't pass <URL> -e in an action

StephenFluin commented 3 years ago

It looks like this should have been fixed in #82 342ae586489f6bf1113ba2ec793eb806896a3be1. Is there any reason it wasn't released?

When I try to use filiph/linkcheck@342ae586489f6bf1113ba2ec793eb806896a3be1, with this .yml

jobs:
  check-links:
    name: Regularly check links
    runs-on: ubuntu-latest
    steps:
      - name: Check docs links with linkcheck
        uses: filiph/linkcheck@342ae586489f6bf1113ba2ec793eb806896a3be1
        with:
          arguments: https://example.com/ -e

I get this error:

Download action repository 'filiph/linkcheck@342ae586489f6bf1113ba2ec793eb806896a3be1' (SHA:342ae586489f6bf1113ba2ec793eb806896a3be1)
Error: filiph/linkcheck/342ae586489f6bf1113ba2ec793eb806896a3be1/action.yml (Line: 16, Col: 5): A sequence was not expected
Error: filiph/linkcheck/342ae586489f6bf1113ba2ec793eb806896a3be1/action.yml (Line: 16, Col: 5): A sequence was not expected
Error: System.ArgumentException: Unexpected type 'SequenceToken' encountered while reading 'entrypoint'. The type 'StringToken' was expected.
   at GitHub.DistributedTask.ObjectTemplating.Tokens.TemplateTokenExtensions.AssertString(TemplateToken value, String objectDescription)
   at GitHub.Runner.Worker.ActionManifestManager.ConvertRuns(IExecutionContext executionContext, TemplateContext templateContext, TemplateToken inputsToken, String fileRelativePath, MappingToken outputs)
   at GitHub.Runner.Worker.ActionManifestManager.Load(IExecutionContext executionContext, String manifestFile)
Error: Fail to load filiph/linkcheck/342ae586489f6bf1113ba2ec793eb806896a3be1/action.yml