From 56d84c3199c28370ecd03750f28947441cc57a47 Mon Sep 17 00:00:00 2001 From: Oliver Sand Date: Fri, 29 Nov 2019 20:12:02 +0100 Subject: [PATCH] Add package_directory parameter --- README.md | 4 ++++ action.yml | 4 ++++ entrypoint.sh | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 78cdfd4..5d2499e 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ This action publishing the Flutter plugin. **Optional** Skip test. Default: `false` +### `package_directory` + +**Optional** Package directory. Default: `"."` + ## Example usage ```yaml diff --git a/action.yml b/action.yml index 23e84bc..55a5460 100644 --- a/action.yml +++ b/action.yml @@ -13,6 +13,10 @@ inputs: description: '(Optional) Skip test (default: false)' required: false default: false + package_directory: + description: '(Optional) Package directory (default: ".")' + required: false + default: '.' runs: using: 'docker' image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index 490fac5..d9b0321 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,6 +11,11 @@ check_credentials() { echo "OK" } +switch_working_directory() { + echo "Switching to package directory" + cd "$INPUT_PACKAGE_DIRECTORY" +} + copy_credential() { echo "Copy credentials" mkdir -p ~/.pub-cache @@ -52,5 +57,6 @@ publish_package() { check_credentials copy_credential +switch_working_directory run_test_if_needed publish_package