Add optional directory
input to GitHub action
#5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Justification
I understand that this is not the most common use case, but some teams use a mono-repo where the
Package.swift
may not be at the root of the project. In my project, I have multiple directories containing multiple Swift Vapor servers. Unfortunately this GitHub action in its current form would not work as it was unable to run the Swift command from the root of the project.Changes
This pull request introduces a new input parameter called "directory". If provided, this will change the active directory to the path provided before running any further commands.
It has been tested with the above snippet, it successfully found the "Ingest" directory. This is not a breaking change.
Apology
I made all the code changes within GitHub's file editor which is not the great but is my excuse for the poor commits. Feel free to squash/rebase into a single commit.