From 6b8ef3323f79800394927cd5098a2575210406af Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sun, 29 May 2022 20:32:23 -0400 Subject: [PATCH] chore: explicitly set the GITHUB_WORKSPACE environment variable (#505) --- action.yml | 2 ++ diff-sha.sh | 6 +++--- entrypoint.sh | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index c0a85082..1313ddc8 100644 --- a/action.yml +++ b/action.yml @@ -158,6 +158,7 @@ runs: GITHUB_BASE_REF: ${{ github.base_ref }} GITHUB_HEAD_REF: ${{ github.head_ref }} GITHUB_ACTION_PATH: ${{ github.action_path }} + GITHUB_WORKSPACE: ${{ github.workspace }} # INPUT_ is not available in Composite run steps # https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611 INPUT_SHA: ${{ inputs.sha }} @@ -187,6 +188,7 @@ runs: shell: bash env: GITHUB_ACTION_PATH: ${{ github.action_path }} + GITHUB_WORKSPACE: ${{ github.workspace }} # INPUT_ is not available in Composite run steps # https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611 INPUT_FILES_PATTERN_FILE: ${{ steps.glob.outputs.paths-output-file }} diff --git a/diff-sha.sh b/diff-sha.sh index cbf4dc85..545a4813 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -4,12 +4,12 @@ set -eu echo "::group::changed-files-diff-sha" -echo "Resolving repository path..." - if [[ -n $INPUT_PATH ]]; then REPO_DIR="$GITHUB_WORKSPACE/$INPUT_PATH" + + echo "Resolving repository path: $REPO_DIR" if [[ ! -d "$REPO_DIR" ]]; then - echo "::warning::Invalid repository path" + echo "::warning::Invalid repository path: $REPO_DIR" exit 1 fi cd "$REPO_DIR" diff --git a/entrypoint.sh b/entrypoint.sh index d07e3008..a2e9c85e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -52,12 +52,12 @@ function get_renames() { echo "::group::changed-files" -echo "Resolving repository path..." - if [[ -n $INPUT_PATH ]]; then REPO_DIR="$GITHUB_WORKSPACE/$INPUT_PATH" + + echo "Resolving repository path: $REPO_DIR" if [[ ! -d "$REPO_DIR" ]]; then - echo "::warning::Invalid repository path" + echo "::warning::Invalid repository path: $REPO_DIR" exit 1 fi cd "$REPO_DIR"