Skip to content

Commit 4df5c3b

Browse files
committed
Fix install-dir when using the default
1 parent e86ddb1 commit 4df5c3b

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

installer-action/action.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,24 @@ inputs:
1212
install-dir:
1313
description: 'Where to install the fatt binary'
1414
required: false
15-
default: '$HOME/.fatt/bin'
15+
default: "$HOME/.fatt/bin"
1616
runs:
1717
using: 'composite'
1818
steps:
19+
# To expand the $HOME environment variable when setting the INSTALL_PATH variable
20+
# this way of adding to the GITHUB_ENV is required. Via yaml syntax 'env: …' will
21+
# not work and result in a relative install-dir like
22+
# /home/runner/work/slsa-workflow-examples/slsa-workflow-examples/$HOME/.fatt/bin.
23+
# where you would expect /home/runner/.fatt/bin
24+
- shell: bash
25+
run: echo "INSTALL_PATH=${{ inputs.install-dir }}" >> $GITHUB_ENV
1926
- shell: bash
2027
run: $GITHUB_ACTION_PATH/install.sh
2128
env:
2229
VERSION: ${{ inputs.fatt-release }}
23-
INSTALL_PATH: ${{ inputs.install-dir }}
2430
- if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
25-
run: |
26-
echo "${{ inputs.install-dir }}" >> $GITHUB_PATH
27-
echo "binary installed at $(command -v fatt)"
31+
run: echo "${{ inputs.install-dir }}" >> $GITHUB_PATH
2832
shell: bash
2933
- if: ${{ runner.os == 'Windows' }}
30-
run: echo "${{ inputs.install-dir }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
34+
run: echo "${{ inputs.install-dir }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
3135
shell: pwsh

installer-action/install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ set -e
1717
GITHUB_API=${GITHUB_API:-'https://api.github.com'}
1818

1919
# default to relative path if INSTALL_PATH is not set
20-
INSTALL_PATH=${INSTALL_PATH:-./.fatt/bin}
20+
# INSTALL_PATH=${INSTALL_PATH:-./.fatt/bin}
2121
mkdir -p "${INSTALL_PATH}"
22-
INSTALL_PATH="$(realpath "${INSTALL_PATH}")"
22+
# INSTALL_PATH="$(realpath "${INSTALL_PATH}")"
2323

2424
VERSION="${VERSION:-v0.2.0-rc}"
2525
RELEASE="https://github.com/philips-labs/fatt/releases/download/${VERSION}"
@@ -81,7 +81,7 @@ DOWNLOAD="${RELEASE}/${ARCHIVE}"
8181
log_info "Installing ${BINARY} (${OS}/${ARCH}) at ${INSTALL_PATH}"
8282

8383
trap "popd >/dev/null" EXIT
84-
pushd "$INSTALL_PATH" >/dev/null || exit
84+
pushd "${INSTALL_PATH}" || exit
8585

8686
download "${ARCHIVE}" "${DOWNLOAD}"
8787

0 commit comments

Comments
 (0)