Skip to content

Commit 447095a

Browse files
authored
limit history (#32)
1 parent 9a9cf99 commit 447095a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/queue_history.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
schedule:
66
- cron: "15 */3 * * *"
77

8+
env:
9+
COMMIT_DEPTH: 500
10+
811
jobs:
912
check-queue:
1013
name: Check Queue
@@ -40,7 +43,7 @@ jobs:
4043
repository: "bevyengine/bevy"
4144
ref: "main"
4245
path: "bevy"
43-
fetch-depth: 100
46+
fetch-depth: ${{ env.COMMIT_DEPTH }}
4447
- uses: actions/checkout@v4
4548
with:
4649
ref: "queue"
@@ -54,7 +57,8 @@ jobs:
5457
run: |
5558
cd bevy
5659
i=0
57-
for commit in `git log --no-abbrev-commit --pretty=oneline | cut -d ' ' -f 1 | head -n 100`
60+
max=3
61+
for commit in `git log --no-abbrev-commit --pretty=oneline | sort | cut -d ' ' -f 1 | head -n ${{ env.COMMIT_DEPTH }}`
5862
do
5963
if find ../results/ | grep $commit 1> /dev/null 2>&1
6064
then
@@ -63,8 +67,11 @@ jobs:
6367
i=$((i + 1))
6468
touch ../queue/$commit
6569
fi
70+
if [ $i -ge $max ]; then
71+
break
72+
fi
6673
done
67-
echo "Added $i commits over the last 100"
74+
echo "Added $i commits"
6875
echo "ADDED=$i" >> "$GITHUB_OUTPUT"
6976
7077
- name: Commit
@@ -75,5 +82,5 @@ jobs:
7582
git config user.email '<>'
7683
7784
git add .
78-
git commit -m "Queue historic commits"
85+
git commit -m "Queue ${{ steps.queue.outputs.ADDED }} historic commits"
7986
git push

0 commit comments

Comments
 (0)