Skip to content

Commit eb62caf

Browse files
committed
stuff that was lost in the previous rebase
1 parent 82663c8 commit eb62caf

File tree

5 files changed

+21
-9
lines changed

5 files changed

+21
-9
lines changed

.github/workflows/bazel.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ on:
6767
type: boolean
6868
default: false
6969
fetch-depth:
70-
description: Number of commits to fetch (0 for full history)
70+
description: Number of commits to fetch (0 for full history, empty for auto-detect)
7171
required: false
72-
type: number
73-
default: 1
72+
type: string
73+
default: ''
7474
cache-name:
7575
description: Name for cache restore (restores {name}.gz with key {name}-)
7676
required: false
@@ -90,11 +90,28 @@ jobs:
9090
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
9191
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
9292
steps:
93+
- name: Calculate fetch depth
94+
id: depth
95+
env:
96+
FETCH_DEPTH: ${{ inputs.fetch-depth }}
97+
PR_COMMITS: ${{ github.event.pull_request.commits }}
98+
run: |
99+
# Use explicit value if provided
100+
if [ -n "$FETCH_DEPTH" ]; then
101+
echo "val=$FETCH_DEPTH" >> "$GITHUB_OUTPUT"
102+
# For PRs, use commit count plus buffer for merge base
103+
elif [ -n "$PR_COMMITS" ]; then
104+
echo "val=$((PR_COMMITS + 2))" >> "$GITHUB_OUTPUT"
105+
# For push events, read commit count from event payload
106+
else
107+
COMMIT_COUNT=$(jq -e '.commits | length // 0' "$GITHUB_EVENT_PATH" 2>/dev/null) || COMMIT_COUNT=0
108+
echo "val=$((COMMIT_COUNT + 1))" >> "$GITHUB_OUTPUT"
109+
fi
93110
- name: Checkout source tree
94111
uses: actions/checkout@v4
95112
with:
96113
ref: ${{ inputs.ref || github.ref }}
97-
fetch-depth: ${{ inputs.fetch-depth }}
114+
fetch-depth: ${{ steps.depth.outputs.val }}
98115
- name: Pull latest changes from head ref for PRs
99116
if: contains(github.head_ref, 'renovate/')
100117
run: git pull origin "$HEAD_REF"

.github/workflows/ci-grid-ui.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ jobs:
2222
steps:
2323
- name: Checkout source tree
2424
uses: actions/checkout@v4
25-
with:
26-
fetch-depth: 50
2725

2826
- name: Setup Node.js
2927
uses: actions/setup-node@v4

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ jobs:
3232
with:
3333
name: Check Targets
3434
cache-name: bazel-test-target-index
35-
fetch-depth: 50
3635
run: |
3736
if [ "${{ github.event_name }}" == "schedule" ] || \
3837
[ "${{ github.event_name }}" == "workflow_call" ] || \

.github/workflows/mirror-selenium-releases.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
- uses: actions/checkout@v4
1818
with:
1919
persist-credentials: false
20-
fetch-depth: 0
2120
- name: Read api.github.com and filter response
2221
run: |
2322
set -euo pipefail

.github/workflows/pre-release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ jobs:
198198
with:
199199
token: ${{ secrets.SELENIUM_CI_TOKEN }}
200200
ref: trunk
201-
fetch-depth: 0
202201
- name: Get latest trunk
203202
run: git pull --ff-only origin trunk
204203
- name: Download all patches

0 commit comments

Comments
 (0)