File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 5555 with :
5656 fetch-depth : 0
5757 - name : Run bazel-diff example script
58- run : USE_BAZEL_VERSION=latest ./bazel-diff-example.sh $(pwd) bazel $(git rev-parse HEAD~1) $(git rev-parse HEAD)
58+ run : USE_BAZEL_VERSION=latest ./bazel-diff-example.sh "$GITHUB_WORKSPACE" ~/go/bin/bazelisk $(git rev-parse HEAD~1) $(git rev-parse HEAD)
5959 test-jre11 :
6060 runs-on : ubuntu-latest
6161 steps :
@@ -103,7 +103,7 @@ jobs:
103103 with :
104104 fetch-depth : 0
105105 - name : Run bazel-diff example script
106- run : USE_BAZEL_VERSION=latest ./bazel-diff-example.sh $(pwd) bazel $(git rev-parse HEAD~1) $(git rev-parse HEAD)
106+ run : USE_BAZEL_VERSION=latest ./bazel-diff-example.sh "$GITHUB_WORKSPACE" ~/go/bin/bazelisk $(git rev-parse HEAD~1) $(git rev-parse HEAD)
107107 deploy :
108108 needs : [test-jre8, test-jre11]
109109 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ set -ex
4+
35# Path to your Bazel WORKSPACE directory
46workspace_path=$1
57# Path to your Bazel executable
@@ -14,27 +16,23 @@ final_hashes_json="/tmp/final_hashes.json"
1416impacted_targets_path=" /tmp/impacted_targets.txt"
1517bazel_diff=" /tmp/bazel_diff"
1618
17- shared_flags=" "
18-
19- # Uncomment the line below to see debug information
20- # shared_flags="--config=verbose"
21-
22- " $bazel_path " run :bazel-diff " $shared_flags " --script_path=" $bazel_diff "
19+ " $bazel_path " run :bazel-diff --script_path=" $bazel_diff "
2320
2421git -C " $workspace_path " checkout " $previous_revision " --quiet
2522
2623echo " Generating Hashes for Revision '$previous_revision '"
2724$bazel_diff generate-hashes -w " $workspace_path " -b " $bazel_path " $starting_hashes_json
2825
29- git -C " $workspace_path " checkout $final_revision --quiet
26+ git -C " $workspace_path " checkout " $final_revision " --quiet
3027
3128echo " Generating Hashes for Revision '$final_revision '"
3229$bazel_diff generate-hashes -w " $workspace_path " -b " $bazel_path " $final_hashes_json
3330
3431echo " Determining Impacted Targets"
3532$bazel_diff get-impacted-targets -sh $starting_hashes_json -fh $final_hashes_json -o $impacted_targets_path
3633
37- IFS=$' \n ' read -d ' ' -r -a impacted_targets < $impacted_targets_path
34+ impacted_targets=()
35+ IFS=$' \n ' read -d ' ' -r -a impacted_targets < $impacted_targets_path || true
3836formatted_impacted_targets=$( IFS=$' \n ' ; echo " ${impacted_targets[*]} " )
3937echo " Impacted Targets between $previous_revision and $final_revision :"
4038echo " $formatted_impacted_targets "
You can’t perform that action at this time.
0 commit comments