|
19 | 19 | CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks |
20 | 20 |
|
21 | 21 | jobs: |
22 | | - # Identify the CodeQL tool versions to use in the analysis job. |
23 | | - check-codeql-versions: |
24 | | - if: github.triggering_actor != 'dependabot[bot]' |
25 | | - runs-on: ubuntu-26.04 |
26 | | - outputs: |
27 | | - versions: ${{ steps.compare.outputs.versions }} |
28 | | - |
29 | | - permissions: |
30 | | - contents: read |
31 | | - # We currently need `security-events: read` to access feature flags. |
32 | | - security-events: read |
33 | | - |
34 | | - steps: |
35 | | - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
36 | | - - name: Set up default CodeQL bundle |
37 | | - id: setup-default |
38 | | - uses: ./setup-codeql |
39 | | - - name: Set up linked CodeQL bundle |
40 | | - id: setup-linked |
41 | | - uses: ./setup-codeql |
42 | | - with: |
43 | | - tools: linked |
44 | | - - name: Compare default and linked CodeQL bundle versions |
45 | | - id: compare |
46 | | - env: |
47 | | - CODEQL_DEFAULT: ${{ steps.setup-default.outputs.codeql-path }} |
48 | | - CODEQL_LINKED: ${{ steps.setup-linked.outputs.codeql-path }} |
49 | | - run: | |
50 | | - CODEQL_VERSION_DEFAULT="$("$CODEQL_DEFAULT" version --format terse)" |
51 | | - CODEQL_VERSION_LINKED="$("$CODEQL_LINKED" version --format terse)" |
52 | | - echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT" |
53 | | - echo "Linked CodeQL bundle version is $CODEQL_VERSION_LINKED" |
54 | | -
|
55 | | - # If we're running on a pull request, run with both bundles, even if `tools: linked` would |
56 | | - # be the same as `tools: null`. This allows us to make the job for each of the bundles a |
57 | | - # required status check. |
58 | | - # |
59 | | - # If we're running on push or schedule, then we can skip running with `tools: linked` when it would be |
60 | | - # the same as running with `tools: null`. |
61 | | - if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$GITHUB_EVENT_NAME" != "merge_group" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LINKED" ]]; then |
62 | | - VERSIONS_JSON='[null]' |
63 | | - else |
64 | | - VERSIONS_JSON='[null, "linked"]' |
65 | | - fi |
66 | | -
|
67 | | - # Output a JSON-encoded list with the distinct versions to test against. |
68 | | - echo "Suggested matrix config for analysis job: $VERSIONS_JSON" |
69 | | - echo "versions=${VERSIONS_JSON}" >> $GITHUB_OUTPUT |
70 | | -
|
71 | 22 | analyze-javascript: |
72 | 23 | if: github.triggering_actor != 'dependabot[bot]' |
73 | | - needs: [check-codeql-versions] |
74 | | - strategy: |
75 | | - fail-fast: false |
76 | | - matrix: |
77 | | - tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }} |
78 | 24 | runs-on: ubuntu-26.04 |
79 | 25 |
|
80 | 26 | permissions: |
|
90 | 36 | with: |
91 | 37 | languages: javascript |
92 | 38 | config-file: ./.github/codeql/codeql-config-javascript.yml |
93 | | - tools: ${{ matrix.tools }} |
94 | 39 | # confirm steps.init.outputs.codeql-path points to the codeql binary |
95 | 40 | - name: Print CodeQL Version |
96 | 41 | run: > |
|
101 | 46 | uses: ./analyze |
102 | 47 | with: |
103 | 48 | category: "/language:javascript" |
104 | | - upload: ${{ (!matrix.tools && github.event_name != 'merge_group' && 'always' ) || 'never' }} |
| 49 | + upload: ${{ (github.event_name != 'merge_group' && 'always') || 'never' }} |
105 | 50 |
|
106 | 51 | analyze-other: |
107 | 52 | if: github.triggering_actor != 'dependabot[bot]' |
|
0 commit comments