From 2e7344b0aac37ab304d3026b0f4337c31b67d0df Mon Sep 17 00:00:00 2001 From: laurentsimon <64505099+laurentsimon@users.noreply.github.com> Date: Wed, 24 Jan 2024 10:39:20 -0800 Subject: [PATCH] fix: Revert "fix: don't move folders if they are already the same (#3089) Reverts slsa-framework/slsa-github-generator#3083 The PR above was merged but does not fix the problem. Need to revert --- internal/builders/gradle/action.yml | 3 +-- internal/builders/maven/action.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/builders/gradle/action.yml b/internal/builders/gradle/action.yml index 852944d19d..1d7c29a31d 100644 --- a/internal/builders/gradle/action.yml +++ b/internal/builders/gradle/action.yml @@ -124,8 +124,7 @@ runs: env: PROJECT_ROOT: ${{ steps.run_gradle_builder.outputs.validated_project_root }} run: | - # ensure that directories are not the same before moving them, preventing an error when running action from the root of the repository - [[ "${PROJECT_ROOT}"/build -ef "${GITHUB_WORKSPACE}"/ ]] || mv "${PROJECT_ROOT}"/build "${GITHUB_WORKSPACE}"/ + mv "${PROJECT_ROOT}"/build "${GITHUB_WORKSPACE}"/ - name: Upload build dir id: upload-build-dir uses: slsa-framework/slsa-github-generator/.github/actions/secure-upload-folder@main diff --git a/internal/builders/maven/action.yml b/internal/builders/maven/action.yml index 5a3c3074b8..bc3ad649ed 100644 --- a/internal/builders/maven/action.yml +++ b/internal/builders/maven/action.yml @@ -105,8 +105,7 @@ runs: && mvn package -Drun.hash.jarfile=true # NOTE: SLSA_OUTPUTS_ARTIFACTS_FILE is a relative path and the project_root may # not be in GITHUB_WORKSPACE, so we need to move the file. - # the following checks if the directories are different before executing the command, fixing an error when SLSA is generated from the root of a repository - [[ $(dirname "${SLSA_OUTPUTS_ARTIFACTS_FILE}") -ef "${GITHUB_WORKSPACE}/../" ]] || mv $(dirname "${SLSA_OUTPUTS_ARTIFACTS_FILE}") "${GITHUB_WORKSPACE}/../" + mv $(dirname "${SLSA_OUTPUTS_ARTIFACTS_FILE}") "${GITHUB_WORKSPACE}/../" mv target "${GITHUB_WORKSPACE}/" # rng generates a random number to avoid name collision in artifacts