Skip to content

Commit 97d0c2f

Browse files
committed
Skip push if no changes
1 parent 5cc455b commit 97d0c2f

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

devops/actions/benchmarking/aggregate/action.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,17 @@ runs:
6666
- name: Upload average to the repo
6767
shell: bash
6868
run: |
69-
# TODO -- waiting on security clearance
7069
cd ./llvm-ci-perf-results
7170
git config user.name "SYCL Benchmarking Bot"
7271
git config user.email "[email protected]"
7372
git pull
74-
git add .
75-
git commit -m "[GHA] Aggregate median data from $SANITIZED_TIMESTAMP to $(date +%Y%m%d_%H%M%S)"
76-
git push "https://[email protected]/$SANITIZED_PERF_RES_GIT_REPO.git" "$SANITIZED_PERF_RES_GIT_BRANCH"
73+
if [ -n "$(git diff)" ]; then
74+
git add .
75+
git commit -m "[GHA] Aggregate median data from $SANITIZED_TIMESTAMP to $(date +%Y%m%d_%H%M%S)"
76+
git push "https://[email protected]/$SANITIZED_PERF_RES_GIT_REPO.git" "$SANITIZED_PERF_RES_GIT_BRANCH"
77+
else
78+
echo "No changes to median, skipping push."
79+
fi
7780
- name: Find aggregated average results artifact here
7881
if: always()
7982
shell: bash

devops/actions/run-tests/benchmark/action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,13 @@ runs:
8181
git config user.name "SYCL Benchmarking Bot"
8282
git config user.email "[email protected]"
8383
git pull
84-
git add .
85-
git commit -m "[GHA] Upload compute-benchmarks results from https://github.com/intel/llvm/actions/runs/${{ github.run_id }}"
86-
git push "https://[email protected]/$SANITIZED_PERF_RES_GIT_REPO.git" "$SANITIZED_PERF_RES_GIT_BRANCH"
84+
if [ -n "$(git diff)" ]; then
85+
git add .
86+
git commit -m "[GHA] Upload compute-benchmarks results from https://github.com/intel/llvm/actions/runs/${{ github.run_id }}"
87+
git push "https://[email protected]/$SANITIZED_PERF_RES_GIT_REPO.git" "$SANITIZED_PERF_RES_GIT_BRANCH"
88+
else
89+
echo "No new results added, skipping push."
90+
fi
8791
- name: Find benchmark result artifact here
8892
if: always()
8993
shell: bash

0 commit comments

Comments
 (0)