Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
feat: add directory input (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien HOUZÉ authored Mar 19, 2020
1 parent e509017 commit e3bf898
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ inputs:
github_package_registry_token:
description: "Github package registry token to install dependencies outside of npm"
default: ""
directory:
description: "directory in which to execute sam command."
default: "./"
runs:
using: "docker"
image: "./Dockerfile"
15 changes: 15 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,24 @@ ${output}
fi
}

function gotoDirectory(){
if [ -z "${INPUT_DIRECTORY}" ]; then
return 1
fi

if [ ! -d "${INPUT_DIRECTORY}" ]; then
echo "Directory ${INPUT_DIRECTORY} does not exists."
exit 127
fi

echo "cd ${INPUT_DIRECTORY}"
cd $INPUT_DIRECTORY
}

function main(){
parseInputs
installAwsSam
gotoDirectory
runSam
}

Expand Down

0 comments on commit e3bf898

Please sign in to comment.