Skip to content

Commit de9f888

Browse files
committed
Fix yarn-install failure
1 parent e4e80c3 commit de9f888

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

build-push-image/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ This is a list of ENV Variables that are used in GH Action:
4242
| name | description |
4343
| -------------------------- | --------------------------------------------------------- |
4444
| `DOCKER_BUILDX_ENDPOINT` | Docker buildx endpoint (Optional if using for GH runners) |
45-
| `GCR_ACCOUNT_KEY` | Necessary token to push image to Google cloud |
4645
| `GITHUB_TOKEN` | GitHub token. Is used to checkout `davinci` branch |
4746
| `TOPTAL_BUILD_BOT_SSH_KEY` | SSH key to access Google cloud |
4847

yarn-install/action.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,16 @@ runs:
161161
NPM_TOKEN: ${{ inputs.npm-token || env.NPM_TOKEN }}
162162
MAX_ATTEMPTS: ${{ inputs.max-attempts }}
163163
run: |
164-
for i in {1..$MAX_ATTEMPTS}; do
165-
printf "Trying to install #%s...\n" "$i"
166-
yarn install --non-interactive && break
167-
sleep 10 # 10s wait time
164+
for ((i=1; i<=MAX_ATTEMPTS; i++)); do
165+
echo "Trying to install (${i}/${MAX_ATTEMPTS})..."
166+
if yarn install --non-interactive; then
167+
echo "Yarn install succeeded on attempt ${i}."
168+
exit 0
169+
fi
170+
sleep 10
168171
done
172+
echo "All installation attempts failed. Exiting with error."
173+
exit 1
169174
170175
# We are manually checking for the changes in yarn.lock file, because
171176
# the `--frozen-lockfile` flag is not working correctly in workspaces with yarn v1

0 commit comments

Comments
 (0)