Skip to content

Commit

Permalink
Set directories relative to github workspace.
Browse files Browse the repository at this point in the history
  • Loading branch information
bummzack committed Oct 22, 2020
1 parent 8ec1e7b commit fccb80e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 0 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
14 changes: 5 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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…"

Expand Down

0 comments on commit fccb80e

Please sign in to comment.