Skip to content

Add workingDirectory argument#283

Merged
mre merged 2 commits intomasterfrom
working-directory
Mar 31, 2025
Merged

Add workingDirectory argument#283
mre merged 2 commits intomasterfrom
working-directory

Conversation

@mre
Copy link
Member

@mre mre commented Mar 27, 2025

Related: #205 (comment)

Usage:

- uses: lycheeverse/lychee-action@v2
  with:
    workingDirectory: fixtures/subdir

@mre mre force-pushed the working-directory branch 3 times, most recently from eca1123 to 8eac377 Compare March 27, 2025 15:21
Copy link

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks!

Does this affect where the output.md lands?

@mre
Copy link
Member Author

mre commented Mar 28, 2025

Good point. It will behave like a cd into the directory, so yes. We should document that.

@mre mre requested a review from thomas-zahner March 28, 2025 10:56
@mre
Copy link
Member Author

mre commented Mar 28, 2025

@Arteiii, can you also take a look and add your thoughts? 😃

@Arteiii
Copy link
Collaborator

Arteiii commented Mar 28, 2025

I'm not sure I can add anything more to this (apart from the changes to the documentation already mentioned to avoid confusion, especially regarding the output directory)

As for the other discussions in the issue (#205 (comment)), I think an option in the workflow to specify the .lycheeignore file would be great, but I'm not sure if there is any support for this in Lychee

@mre
Copy link
Member Author

mre commented Mar 28, 2025

Thanks for checking in.
At the moment, there is no support in lychee for that. I think it won't be super easy to do. It might be a can of worms I'm not willing to open for now. 😅

@Arteiii
Copy link
Collaborator

Arteiii commented Mar 28, 2025

Well, for the workflow there might be a hacky workaround by using the new workingDirectory arg

- uses: lycheeverse/lychee-action@v2
  with:
    workingDirectory: .github/workflows
    args: "--verbose --no-progress '../../**/*.md' '../../**/*.html' '../../**/*.rst'"

Not the best solution, but it should work

@mre
Copy link
Member Author

mre commented Mar 28, 2025

True, or

- uses: lycheeverse/lychee-action@v2
  with:
    workingDirectory: .github/workflows
    args: >-
      --verbose 
      --no-progress 
      '${{ github.workspace }}/**/*.md' 
      '${{ github.workspace }}/**/*.html' 
      '${{ github.workspace }}/**/*.rst'

Not sure which version I prefer.

@thomas-zahner
Copy link
Member

Looks good to me.
It's just the documentation about the modified output directory when using the argument which is still missing.

@mre mre merged commit 1d97d84 into master Mar 31, 2025
5 checks passed
@mre mre deleted the working-directory branch March 31, 2025 12:25
@mre
Copy link
Member Author

mre commented Mar 31, 2025

Thanks for the reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants