File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -79,23 +79,18 @@ jobs:
79
79
80
80
echo "Getting commits from date: $TARGET_DATE"
81
81
82
- # Get commits from the target date (00:00 to 23:59 UTC)
83
- COMMITS =$(git log --since="$TARGET_DATE 00:00:00 UTC" --until="$TARGET_DATE 23:59:59 UTC" --pretty=format:"%H" --reverse )
82
+ # Get the last commit from the target date
83
+ LAST_COMMIT =$(git log --since="$TARGET_DATE 00:00:00 UTC" --until="$TARGET_DATE 23:59:59 UTC" --pretty=format:"%H" -n 1 )
84
84
85
- if [ -z "$COMMITS " ]; then
85
+ if [ -z "$LAST_COMMIT " ]; then
86
86
echo "No commits found for date $TARGET_DATE"
87
87
exit 1
88
88
else
89
- COMMIT_COUNT=$( echo "$COMMITS" | wc -l)
90
- FIRST_COMMIT=$( echo "$COMMITS" | head -1)
91
- LAST_COMMIT=$( echo "$COMMITS" | tail -1)
89
+ echo "Found last commit for date $TARGET_DATE: $LAST_COMMIT"
90
+ echo "COMMIT_RANGE=$LAST_COMMIT" >> $GITHUB_ENV
91
+ echo "COMMIT_COUNT=1" >> $GITHUB_ENV
92
92
93
- echo "Found $COMMIT_COUNT commits for date $TARGET_DATE"
94
- echo "COMMIT_RANGE=${FIRST_COMMIT}..${LAST_COMMIT}" >> $GITHUB_ENV
95
- echo "COMMIT_COUNT=$COMMIT_COUNT" >> $GITHUB_ENV
96
-
97
- echo "Commits to benchmark:"
98
- echo "$COMMITS"
93
+ echo "Commit to benchmark: $LAST_COMMIT"
99
94
fi
100
95
101
96
- name : Print environment variables
You can’t perform that action at this time.
0 commit comments