When using yarn, it will create a yarn.lock
lockfile which holds data on your used dependencies. This file also includes hard-typed versions, so should you update your dependencies, the yarn.lock
file is basically outdated and needs to be regenerated. While yarn does this automatically, Greenkeeper pull requests that update dependencies as of right now do not do this regeneration, which means you would have to do it manually.
This gist shows you a way how to automatise this step using a Jenkins CI script.
- You use Jenkins CI and have it build Pull Requests from Github.
- You have a
yarn.lock
file in your repository for Jenkins CI and yarn installed on your jenkins server.
You will need the have github access set up in jenkins. It is likely you will already have this if your PRs are being automatically built by Jenkins.
Add the step in the Jenkinsfile below to your Jenkinsfile. Change YOUR_CREDENTIALS_ID for the id of your github credentials saved in Jenkins.
Note:
- This lockfile update will only occur if the branch name includes "greenkeeper"
- It will only push a commit if the yarn lockfile is changed