File tree 6 files changed +20
-8
lines changed
6 files changed +20
-8
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' davinci-github-actions ' : patch
3
+ ---
4
+
5
+ ### yarn-install
6
+
7
+ - ensure the workflow fails correctly if ` yarn install ` encounters an error
Original file line number Diff line number Diff line change @@ -40,10 +40,10 @@ jobs:
40
40
with :
41
41
ref : ${{ github.event.pull_request.head.sha }}
42
42
43
- - name : Set up Node.js 20
43
+ - name : Set up Node.js
44
44
45
45
with :
46
- node-version : 20
46
+ node-version-file : .nvmrc
47
47
48
48
- uses : ./yarn-install
49
49
Original file line number Diff line number Diff line change 56
56
- name : Set up node
57
57
58
58
with :
59
- node-version : 20
59
+ node-version-file : .nvmrc
60
60
61
61
- uses : ./yarn-install
62
62
Original file line number Diff line number Diff line change
1
+ 20.18.3
Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ This is a list of ENV Variables that are used in GH Action:
42
42
| name | description |
43
43
| -------------------------- | --------------------------------------------------------- |
44
44
| ` DOCKER_BUILDX_ENDPOINT ` | Docker buildx endpoint (Optional if using for GH runners) |
45
- | ` GCR_ACCOUNT_KEY ` | Necessary token to push image to Google cloud |
46
45
| ` GITHUB_TOKEN ` | GitHub token. Is used to checkout ` davinci ` branch |
47
46
| ` TOPTAL_BUILD_BOT_SSH_KEY ` | SSH key to access Google cloud |
48
47
Original file line number Diff line number Diff line change @@ -161,11 +161,16 @@ runs:
161
161
NPM_TOKEN : ${{ inputs.npm-token || env.NPM_TOKEN }}
162
162
MAX_ATTEMPTS : ${{ inputs.max-attempts }}
163
163
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
168
171
done
172
+ echo "All installation attempts failed. Exiting with error."
173
+ exit 1
169
174
170
175
# We are manually checking for the changes in yarn.lock file, because
171
176
# the `--frozen-lockfile` flag is not working correctly in workspaces with yarn v1
You can’t perform that action at this time.
0 commit comments