Skip to content

Commit 5d3bf98

Browse files
authored
chore(ci): package-lock is updated from separate job (#28697)
After each release, we need to update the local `package-lock.json` dependencies. We do this via a `npm install --package-lock-only` command. However, this command can fail for reasons such as a connection timeout. When this happens, the package-lock files do not get updated. The problem is this action is also done in the same job as generating the changelog and creating the GitHub release. This operations cannot be re-done. As a result, we cannot simply re-run this job and try updating the package-lock files again. This PR changes the workflow to split the package-lock update out to its own job. In the event that this job fails, we can re-run only this job and leave the other jobs untouched.
1 parent 16f39d9 commit 5d3bf98

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,25 @@ jobs:
6969
env:
7070
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7171
shell: bash
72-
# Lerna does not automatically bump versions
73-
# of Ionic dependencies that have changed,
74-
# so we do that here.
75-
- name: Bump Package Lock
76-
run: |
77-
lerna exec "npm install --package-lock-only"
78-
git add .
79-
git commit -m "chore(): update package lock files"
80-
git push
81-
shell: bash
72+
73+
update-package-lock:
74+
# This needs to run after finalize-release
75+
# because we also push to the repo in that
76+
# job. If these jobs ran in parallel then it is
77+
# possible for them to push at the same time.
78+
needs: [finalize-release]
79+
runs-on: ubuntu-latest
80+
steps:
81+
# Lerna does not automatically bump versions
82+
# of Ionic dependencies that have changed,
83+
# so we do that here.
84+
- name: Bump Package Lock
85+
run: |
86+
lerna exec "npm install --package-lock-only"
87+
git add .
88+
git commit -m "chore(): update package lock files"
89+
git push
90+
shell: bash
8291

8392
purge-cdn-cache:
8493
needs: [release-ionic]

0 commit comments

Comments
 (0)