How to add dependencies so code scanning can work?

I have been trying to set up code scanning on one of my repositories. The repository hold code in c. However when the workflow runs to build the code so it can be scanned, it fails due to not having the right dependencies installed. How can I get the dependencies added so the code can be built and scanned?

You’ll need to add a step (or more) that installs the dependencies before the code scanning steps. Exactly how to do that depends on the dependencies and the platform you are using. For example, in one of my workflows I do this:

      - name: install dependencies
        run: |
          sudo apt-get update
          sudo apt-get -y install python3-yaml apache2-bin apache2-dev gnutls-bin libapr1-dev libgnutls28-dev libmsv-dev pkg-config procps