|
| 1 | +# :whale: `codeql-learninglab-check` |
| 2 | + |
| 3 | +This is the docker image used as the base for query-checking actions used by |
| 4 | +CodeQL Learning Lab courses, |
| 5 | +and it is [published to GitHub |
| 6 | +Packages](https://github.com/github/codeql-learninglab-actions/packages/95228). |
| 7 | + |
| 8 | +## Usage |
| 9 | + |
| 10 | +For instructions on how to use this docker image, please see |
| 11 | +[Creating your own course](../README.md#creating-your-own-course) |
| 12 | +in the main README. |
| 13 | + |
| 14 | +## Architecture / Components |
| 15 | + |
| 16 | +This docker image bundles a number of elements: |
| 17 | + |
| 18 | +* **Dependency:** Some debian packages, importantly including Node v12. |
| 19 | +* **Dependency:** The CodeQL CLI binaries from |
| 20 | + [`codeql-cli-binaries`](https://github.com/github/codeql-cli-binaries/releases) |
| 21 | +* **Dependency:** A checkout of the [`Semmle/ql`](https://github.com/Semmle/ql) |
| 22 | + repository, pinned to a specific version. |
| 23 | +* The core action JavaScript/TypeScript code from [`package/`](package), |
| 24 | + and all its NPM dependencies. |
| 25 | + |
| 26 | +## Updating the CodeQL dependencies |
| 27 | + |
| 28 | +You will want to make sure that the versions of the CodeQL CLI and `Semmle/ql` |
| 29 | +are compatible. |
| 30 | + |
| 31 | +* **Updating the CodeQL CLI**: Modify the URL for the CLI in |
| 32 | + [`Dockerfile`](Dockerfile). |
| 33 | +* **Updating the `Semmle/ql` repo**: Update the `RUN git checkout <ref>` line in |
| 34 | + [`Dockerfile`](Dockerfile) to a git sha / reference that is compatible with |
| 35 | + the version of the CodeQL CLI that is in use. |
| 36 | + |
| 37 | +## Releasing |
| 38 | + |
| 39 | +After making changes to any of the elements of this docker image, |
| 40 | +including the source code in `package/`, |
| 41 | +for courses to make use of these changes you need to make a release. |
| 42 | + |
| 43 | +This repository has a GitHub Actions workflow configured on pushes to `master` |
| 44 | +to automatically publish the image |
| 45 | +using the script [`publish.sh`](publish.sh). |
| 46 | +It will check to see if an image has already been published for the current |
| 47 | +version, |
| 48 | +and if not it will build and publish the image automatically. |
| 49 | +So to publish a new version, |
| 50 | +simply change the `IMAGE_VERSION` variable in [`publish.sh`](publish.sh), |
| 51 | +and push to `master`. |
| 52 | + |
| 53 | +**Note: it's probably best to avoid publishing to `latest` so that courses have |
| 54 | +to specify an explicit as their base images, |
| 55 | +so that courses won't break unexpectedly with breaking changes to this image** |
| 56 | + |
| 57 | +### Updating downstream dependencies |
| 58 | + |
| 59 | +Once you have updated this base image, |
| 60 | +you probably want to also update a number of the courses to use this updated |
| 61 | +image. |
| 62 | + |
| 63 | +See the main [CONTRIBUTING.md](../CONTRIBUTING.md) file for more info. |
0 commit comments