Skip to content

Commit a2080d4

Browse files
[ci]: A minor optimization only fetch original commits when necessary — especially important for large-scale projects like React.
1 parent 693803a commit a2080d4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/devtools_regression_tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ jobs:
4444
- run: yarn --cwd scripts/release install --frozen-lockfile
4545
if: steps.node_modules.outputs.cache-hit != 'true'
4646
- name: Download react-devtools artifacts for base revision
47+
env:
48+
GH_TOKEN: ${{ github.token }}
4749
run: |
48-
git fetch origin main
49-
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=${{ inputs.commit_sha || '$(git rev-parse origin/main)' }}
50+
commit="${{ inputs.commit_sha }}"
51+
if [ -z "$commit" ]; then
52+
git fetch origin main
53+
commit="$(git rev-parse origin/main)"
54+
fi
55+
scripts/release/download-experimental-build.js --commit="$commit"
5056
- name: Display structure of build
5157
run: ls -R build
5258
- name: Archive build

0 commit comments

Comments
 (0)