3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2025-01-29 03:34:50 +00:00

chore: explicitly set the GITHUB_WORKSPACE environment variable (#505)

This commit is contained in:
Tonye Jack 2022-05-29 20:32:23 -04:00 committed by GitHub
parent 1c997727c9
commit 6b8ef3323f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View file

@ -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_<VARIABLE_NAME> 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_<VARIABLE_NAME> 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 }}

View file

@ -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"

View file

@ -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"