Skip to content

Commit 6d7f29a

Browse files
authored
Exercise Clarifications
multiple campers got stuck at this same point - adding more direction
1 parent f8813da commit 6d7f29a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

exercises/lab 3 - code-scanning.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ CodeQL requires a build of compiled languages. An analysis job can fail if our *
2929

3030
1. Inside the workflow you'll see a list of jobs on the left. Click on the Java job to view the logging output and review any errors to determine if there's a build failure.
3131

32-
2. The build failure appears to be caused by a JDK version mismatch. Our project targets JDK version 15. How can we check the Java version that the GitHub hosted runner is using? Does the logging output provide any helpful information?
32+
2. The `autobuild` compilation failure appears to be caused by a JDK version mismatch. Our project targets JDK version 15. How can we check the Java version that the GitHub hosted runner is using? Does the logging output provide any helpful information?
3333

3434
<details>
3535
<summary>Solution</summary>
3636

37-
- GitHub saves workflow files in the `.github/workflows` directory of your repository. You can add a command to the workflow that returns the Java version.
37+
- GitHub saves workflow files in the `.github/workflows` directory of your repository. You can add a command to the existing `codeql-analysis.yml` workflow to output the Java version. Add this anywhere before the step that is failing to help in your debugging:
3838

3939
```yaml
4040
- run: |
@@ -44,7 +44,7 @@ CodeQL requires a build of compiled languages. An analysis job can fail if our *
4444
4545
</details>
4646
47-
3. Resolve the JDK version issue by using the `setup-java` Action to specify a version.
47+
3. The previous debugging has concluded that we have a mismatch. Resolve the JDK version issue by using the `setup-java` Action in `codeql-analysis.yml` to explicitly specify a version. This should be added to the workflow before the `autobuild` step to properly configure the runtime environment before the build.
4848

4949
<details>
5050
<summary>Solution</summary>
@@ -59,7 +59,7 @@ CodeQL requires a build of compiled languages. An analysis job can fail if our *
5959

6060
#### Using context and expressions to modify build
6161

62-
How would you [modify](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions) the workflow such that the autobuild step only targets Java?
62+
How would you [modify](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions) the workflow such that the autobuild step only targets compiled languages (`java` in our repository)?
6363

6464
<details>
6565
<summary>Solution</summary>
@@ -68,7 +68,7 @@ How would you [modify](https://docs.github.com/en/free-pro-team@latest/actions/r
6868

6969
```yaml
7070
- if: matrix.language == 'java'
71-
uses: github/codeql-action/autobuild@v1
71+
uses: github/codeql-action/autobuild@v2
7272
```
7373
</details>
7474

0 commit comments

Comments
 (0)