Skip to content

Conversation

@github-learning-lab
Copy link

Update the dependency

Next, we'll go through the GitHub Flow to make some changes. If you aren't sure how to do this, try the Introduction to GitHub course and then come back to give it another try.

Note: For production code, it's a good idea to do some integration testing to make sure that the upgraded package works with your code. Good unit tests and Continuous Integration (CI) will help you update with confidence. The Learning Lab course GitHub Actions: Continuous Integration can teach you how to set up CI!

Step 4: Updating dependency versions

Now that you know the recommended version, it's time to edit the package.json file. You'll upgrade the package to a non-vulnerable version.

⌨️ Activity: Update the package.json file

  1. Within this pull request, go to Files changed.
  2. Click the ellipsis (...) in the right upper corner and click Edit file to edit the package.json file.
  3. Fix the vulnerability by updating to the latest version of the dependency that you took note of earlier, version 2.6.9 of debug.
  4. Scroll down, and commit your change.

@github-learning-lab
Copy link
Author

Step 3: Merge this pull request

Great job, @SyChell, your pull request looks good. Thank you for fixing the vulnerable dependency!

Note: You might notice that this repository has a package.json file, but no package-lock.json file. In production code it's a good idea to have both files to avoid conflicts resolving the proper version of a dependency. For simplicity, we'll use only package.json, but GitHub monitors both files in addition to the gamut of supported languages and packages

⌨️ Activity: Merge

  1. Merge this pull request.

@SyChell SyChell merged commit 20353d2 into main Mar 18, 2021
@github-learning-lab
Copy link
Author

Nice job merging @SyChell. Go ahead and delete the branch.


Let's see how we can automate this process. Navigate to your next issue.

@SyChell SyChell deleted the update-dependency branch March 18, 2021 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants