Files
react-native/.github/actions/yarn-install/action.yml
Nicola Corti a7a51275b5 Do not setup-node twice in test_js (#52737)
Summary:
I've noticed that test_js (20) and test_js (24) are actually running on Node 22.
That's because the `yarn-install` action is invoking setup-node again with the default value (22).

This changes it. Also I'm cleaning up the workflows so that every `yarn-install` invocation is happening just after the `setup-node` invocation.

## Changelog:

[INTERNAL] -

Pull Request resolved: https://github.com/facebook/react-native/pull/52737

Test Plan: CI which will most likely be red for test_js (20) so will need a follow-up

Reviewed By: cipolleschi

Differential Revision: D78664671

Pulled By: cortinico

fbshipit-source-id: c73390930d1511d1bf0f2d4ea92e83f50b10247f
2025-07-21 08:51:05 -07:00

21 lines
615 B
YAML

name: yarn-install
runs:
using: composite
steps:
- name: Install dependencies
shell: bash
run: |
MAX_ATTEMPTS=2
ATTEMPT=0
WAIT_TIME=20
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
yarn install --non-interactive --frozen-lockfile && break
echo "yarn install failed. Retrying in $WAIT_TIME seconds..."
sleep $WAIT_TIME
ATTEMPT=$((ATTEMPT + 1))
done
if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then
echo "All attempts to invoke yarn install failed - Aborting the workflow"
exit 1
fi