Skip to content

Commit 4e97a72

Browse files
committed
try copy RNTA's yarn install action
1 parent 8d1983c commit 4e97a72

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed
+13-16
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
name: yarn-install
1+
name: Yarn
2+
description: Runs `yarn install`
3+
inputs:
4+
immutable:
5+
description: Abort with an error exit code if the lockfile was to be modified
6+
default: true
27
runs:
38
using: composite
49
steps:
5-
- name: Install dependencies
10+
- name: Install npm dependencies
11+
if: ${{ inputs.immutable == 'true' }}
12+
run: yarn
13+
shell: bash
14+
- name: Install npm dependencies (ignore lockfile changes)
15+
if: ${{ inputs.immutable != 'true' }}
16+
run: yarn --no-immutable
617
shell: bash
7-
run: |
8-
MAX_ATTEMPTS=2
9-
ATTEMPT=0
10-
WAIT_TIME=20
11-
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
12-
yarn install --non-interactive --frozen-lockfile && break
13-
echo "yarn install failed. Retrying in $WAIT_TIME seconds..."
14-
sleep $WAIT_TIME
15-
ATTEMPT=$((ATTEMPT + 1))
16-
done
17-
if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then
18-
echo "All attempts to invoke yarn install failed - Aborting the workflow"
19-
exit 1
20-
fi

0 commit comments

Comments
 (0)