From fccb80e0336660c6a179213604f8afa71141133e Mon Sep 17 00:00:00 2001 From: Roman Schmid Date: Thu, 22 Oct 2020 12:00:55 +0200 Subject: [PATCH] Set directories relative to github workspace. --- README.md | 2 +- action.yml | 2 -- entrypoint.sh | 14 +++++--------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 425ccb3..2989c96 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The build-repository will get generated automatically. Branches will be mirrored #### `source` -**Optional** The build output directory. Default `"build"`. +**Optional** The build output directory, relative to the `GITHUB_WORKSPACE`. Default `"build"`. #### `suffix` diff --git a/action.yml b/action.yml index 103aed0..006f17f 100644 --- a/action.yml +++ b/action.yml @@ -26,8 +26,6 @@ inputs: runs: using: 'docker' image: 'Dockerfile' - args: - - ${{ inputs.source }} env: GIT_COMMITTER_EMAIL: ${{ inputs.committer_email }} GIT_COMMITTER_NAME: ${{ inputs.committer_name }} diff --git a/entrypoint.sh b/entrypoint.sh index ba676b6..5f44de6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,14 +2,10 @@ set -e -if [[ $# -ne 1 || ! -d "$1" ]]; then - echo "Need a source dir as first param" - exit 2 -fi - # Initialize variables from inputs -source=$1 -source_path="$(realpath $source)" +source_dir=${INPUT_SOURCE:-build} +source_path="$GITHUB_WORKSPACE/$source_dir" +#source_path="$(realpath $source)" build_suffix=${INPUT_SUFFIX:--build} # GITHUB_REF and GITHUB_REPOSITORY are part of the default ENV variables from Github @@ -43,8 +39,8 @@ fi repo_url="https://${API_USERNAME}:${API_ACCESS_TOKEN}@github.com/$build_repo.git" -dir=build-artefacts-tmp -git log --pretty=format:"%s" > $source/.gitlog +dir="$GITHUB_WORKSPACE/build-artefacts-tmp" +git log --pretty=format:"%s" > $source_path/.gitlog echo "Checking if branch $branch already exists…"