Skip to content

Commit

Permalink
fix: Revert "fix: don't move folders if they are already the same (#3089
Browse files Browse the repository at this point in the history
)

Reverts #3083

The PR above was merged but does not fix the problem. Need to revert
  • Loading branch information
laurentsimon committed Jan 24, 2024
1 parent 47019a5 commit 2e7344b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions internal/builders/gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions internal/builders/maven/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2e7344b

Please sign in to comment.