* Improve documentation issue no #1034 Done with the minor fixes for open issue number #1034 . * Increasing the importance I wanted to delete a branch, but I couldn't in spite of reading this document. The problem was, the branch I wanted to delete was the default branch. Even though it is stated in this document, it was not given enough importance that everyone would see it. * typo A small type in the comments * Update setting-up-your-development-environment-to-create-a-github-app.md Fix two small typos. * properly capitalize "macOS" * Clarify GH password requirements * Change " to ` As done in the description of `master` * " to ` in DE * " to ` in PT * " to ` in RU * Fix typo metadata-syntax-for-github-actions.md Fix typo for metadata-syntax-for-github-actions#outputs-for-composite-run-steps-actions * chore: Remove bolding from headings * Removed deprecated echo set-env instruction * fix typo (#1516) Co-authored-by: hubwriter <hubwriter@github.com> * Remove extraneous grammar period which breaks the compare URL (#1252) * Remove extraneous grammar period which breaks the compare URL * Update data/reusables/repositories/two-dot-diff-comparison-example-urls.md Co-authored-by: Nick Schonning <nschonni@gmail.com> Co-authored-by: Nick Schonning <nschonni@gmail.com> Co-authored-by: hubwriter <hubwriter@github.com> * Revert "" to ` in RU" This reverts commitd484fd6ef5. * Revert "" to ` in PT" This reverts commitfab62f05be. * Revert "" to ` in DE" This reverts commit78abcd6f7a. * Change md This squashes all the translation commits and their deletion. * Update content/github/collaborating-with-issues-and-pull-requests/creating-and-deleting-branches-within-your-repository.md Co-authored-by: Felicity Chapman <felicitymay@github.com> Co-authored-by: Atharva Shirdhankar <72031540+StarTrooper08@users.noreply.github.com> Co-authored-by: Aakarsh B <aakarshbiju@gmail.com> Co-authored-by: Aritra Roy Gosthipaty <aritra.born2fly@gmail.com> Co-authored-by: Guilherme Macedo <guilherme@gmacedo.com> Co-authored-by: Stephen Wade <stephen@stephenwade.me> Co-authored-by: Shao Yang Hong <hongsy2006@gmail.com> Co-authored-by: a2br <62328077+a2br@users.noreply.github.com> Co-authored-by: Cas van Dinter <casvd@hotmail.com> Co-authored-by: Nick Schonning <nschonni@gmail.com> Co-authored-by: Antoine Rondelet <rondelet.antoine@gmail.com> Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com> Co-authored-by: Meg Bird <megbird@github.com> Co-authored-by: ねず <39144575+wonda-tea-coffee@users.noreply.github.com> Co-authored-by: hubwriter <hubwriter@github.com> Co-authored-by: Ilia <ilia@wearebond.com> Co-authored-by: a2br <a2br@users.noreply.github.com> Co-authored-by: Felicity Chapman <felicitymay@github.com> Co-authored-by: Jason Etcovitch <jasonetco@github.com>
70 lines
3.7 KiB
Markdown
70 lines
3.7 KiB
Markdown
---
|
|
title: Running CodeQL code scanning in a container
|
|
shortTitle: '{% data variables.product.prodname_code_scanning_capc %} in a container'
|
|
intro: 'You can run {% data variables.product.prodname_code_scanning %} in a container by ensuring that all processes run in the same container.'
|
|
product: '{% data reusables.gated-features.code-scanning %}'
|
|
versions:
|
|
free-pro-team: '*'
|
|
enterprise-server: '>=2.22'
|
|
---
|
|
|
|
{% data reusables.code-scanning.beta %}
|
|
|
|
### About {% data variables.product.prodname_code_scanning %} with a containerized build
|
|
|
|
If you're setting up {% data variables.product.prodname_code_scanning %} for a compiled language, and you're building the code in a containerized environment, the analysis may fail with the error message "No source code was seen during the build." This indicates that {% data variables.product.prodname_codeql %} was unable to monitor your code as it was compiled.
|
|
|
|
You must run {% data variables.product.prodname_codeql %} in the same container in which you build your code. This applies whether you are using the {% data variables.product.prodname_codeql_runner %}, or {% data variables.product.prodname_actions %}. If you're using the {% data variables.product.prodname_codeql_runner %}, run it in the container where your code builds. For more information about the {% data variables.product.prodname_codeql_runner %}, see "[Running {% data variables.product.prodname_codeql %} in your CI system](/github/finding-security-vulnerabilities-and-errors-in-your-code/running-code-scanning-in-your-ci-system)." If you're using {% data variables.product.prodname_actions %}, configure your workflow to run all the actions in the same container. For more information, see "[Example workflow](#example-workflow)."
|
|
|
|
### Dependencies
|
|
|
|
You may have difficulty running {% data variables.product.prodname_code_scanning %} if the container you're using is missing certain dependencies (for example, Git must be installed and added to the PATH variable). If you encounter dependency issues, review the list of software typically included on {% data variables.product.prodname_dotcom %}'s virtual environments. For more information, see the version-specific `readme` files in these locations:
|
|
|
|
* Linux: https://github.com/actions/virtual-environments/tree/main/images/linux
|
|
* macOS: https://github.com/actions/virtual-environments/tree/main/images/macos
|
|
* Windows: https://github.com/actions/virtual-environments/tree/main/images/win
|
|
|
|
### Example workflow
|
|
|
|
This sample workflow uses {% data variables.product.prodname_actions %} to run {% data variables.product.prodname_codeql %} analysis in a containerized environment. The value of `container.image` identifies the container to use. In this example the image is named `codeql-container`, with a tag of `f0f91db`. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontainer)."
|
|
|
|
``` yaml
|
|
name: "{% data variables.product.prodname_codeql %}"
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
schedule:
|
|
- cron: '0 0 * * 0'
|
|
|
|
jobs:
|
|
analyze:
|
|
name: Analyze
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
language: [java]
|
|
|
|
# Specify the container in which actions will run
|
|
container:
|
|
image: codeql-container:f0f91db
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
- name: Initialize {% data variables.product.prodname_codeql %}
|
|
uses: github/codeql-action/init@v1
|
|
with:
|
|
languages: {% raw %}${{ matrix.language }}{% endraw %}
|
|
- name: Build
|
|
run: |
|
|
./configure
|
|
make
|
|
- name: Perform {% data variables.product.prodname_codeql %} Analysis
|
|
uses: github/codeql-action/analyze@v1
|
|
```
|