Skip to content

Commit

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

This reverts commit 2e7344b.
  • Loading branch information
ramonpetgrave64 committed Mar 20, 2024
1 parent 3bad350 commit 0211a54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/builders/gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ runs:
env:
PROJECT_ROOT: ${{ steps.run_gradle_builder.outputs.validated_project_root }}
run: |
mv "${PROJECT_ROOT}"/build "${GITHUB_WORKSPACE}"/
# 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}"/
- name: Upload build dir
id: upload-build-dir
uses: slsa-framework/slsa-github-generator/.github/actions/secure-upload-folder@main
Expand Down
3 changes: 2 additions & 1 deletion internal/builders/maven/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ 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.
mv $(dirname "${SLSA_OUTPUTS_ARTIFACTS_FILE}") "${GITHUB_WORKSPACE}/../"
# 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 target "${GITHUB_WORKSPACE}/"
# rng generates a random number to avoid name collision in artifacts
Expand Down

0 comments on commit 0211a54

Please sign in to comment.