Skip to content

Commit afb8702

Browse files
authored
Merge branch 'main' into prompt-injection
2 parents 4542681 + 2015125 commit afb8702

File tree

702 files changed

+151858
-54998
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

702 files changed

+151858
-54998
lines changed

.github/workflows/compile-queries.yml

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,41 @@ permissions:
1717
contents: read
1818

1919
jobs:
20-
compile-queries:
20+
detect-changes:
2121
if: github.repository_owner == 'github'
22+
runs-on: ubuntu-latest
23+
outputs:
24+
languages: ${{ steps.detect.outputs.languages }}
25+
steps:
26+
- uses: actions/checkout@v5
27+
- name: Detect changed languages
28+
id: detect
29+
run: |
30+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
31+
# For PRs, detect which languages have changes
32+
changed_files=$(gh pr view ${{ github.event.pull_request.number }} --json files --jq '.files.[].path')
33+
languages=()
34+
for lang in actions cpp csharp go java javascript python ql ruby rust swift; do
35+
if echo "$changed_files" | grep -qE "^($lang/|shared/)" ; then
36+
languages+=("$lang")
37+
fi
38+
done
39+
echo "languages=$(jq -c -n '$ARGS.positional' --args "${languages[@]}")" >> $GITHUB_OUTPUT
40+
else
41+
# For pushes to main/rc branches, run all languages
42+
echo 'languages=["actions","cpp","csharp","go","java","javascript","python","ql","ruby","rust","swift"]' >> $GITHUB_OUTPUT
43+
fi
44+
env:
45+
GH_TOKEN: ${{ github.token }}
46+
47+
compile-queries:
48+
needs: detect-changes
49+
if: github.repository_owner == 'github' && needs.detect-changes.outputs.languages != '[]'
2250
runs-on: ubuntu-latest-xl
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
language: ${{ fromJson(needs.detect-changes.outputs.languages) }}
2355

2456
steps:
2557
- uses: actions/checkout@v5
@@ -31,16 +63,16 @@ jobs:
3163
id: query-cache
3264
uses: ./.github/actions/cache-query-compilation
3365
with:
34-
key: all-queries
66+
key: ${{ matrix.language }}-queries
3567
- name: check formatting
36-
run: find shared */ql -type f \( -name "*.qll" -o -name "*.ql" \) -print0 | xargs -0 -n 3000 -P 10 codeql query format -q --check-only
68+
run: find shared ${{ matrix.language }}/ql -type f \( -name "*.qll" -o -name "*.ql" \) -print0 | xargs -0 -n 3000 -P 10 codeql query format -q --check-only
3769
- name: compile queries - check-only
3870
# run with --check-only if running in a PR (github.sha != main)
3971
if : ${{ github.event_name == 'pull_request' }}
4072
shell: bash
41-
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --check-only --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" --compilation-cache-size=500 --ram=56000
73+
run: codeql query compile -q -j0 ${{ matrix.language }}/ql/{src,examples} --keep-going --warnings=error --check-only --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" --compilation-cache-size=500 --ram=56000
4274
- name: compile queries - full
4375
# do full compile if running on main - this populates the cache
4476
if : ${{ github.event_name != 'pull_request' }}
4577
shell: bash
46-
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" --compilation-cache-size=500 --ram=56000
78+
run: codeql query compile -q -j0 ${{ matrix.language }}/ql/{src,examples} --keep-going --warnings=error --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" --compilation-cache-size=500 --ram=56000

.github/workflows/ql-for-ql-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
uses: github/codeql-action/init@main
2828
with:
2929
languages: javascript # does not matter
30+
tools: nightly
3031
- uses: ./.github/actions/os-version
3132
id: os_version
3233
### Build the extractor ###

.github/workflows/ql-for-ql-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
uses: github/codeql-action/init@main
3131
with:
3232
languages: javascript # does not matter
33+
tools: nightly
3334
- uses: ./.github/actions/os-version
3435
id: os_version
3536
- uses: actions/cache@v3
@@ -75,6 +76,7 @@ jobs:
7576
uses: github/codeql-action/init@main
7677
with:
7778
languages: javascript # does not matter
79+
tools: nightly
7880
- uses: ./.github/actions/os-version
7981
id: os_version
8082
- uses: actions/cache@v3
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
lockVersion: 1.0.0
3+
dependencies: {}
4+
compiled: false

actions/ql/examples/qlpack.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: codeql/actions-examples
2+
groups:
3+
- actions
4+
- examples
5+
dependencies:
6+
codeql/actions-all: ${workspace}
7+
warnOnImplicitThis: true
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @name Uses step with pinned SHA
3+
* @description Finds 'uses' steps where the version is a pinned SHA.
4+
* @id actions/examples/uses-pinned-sha
5+
* @tags example
6+
*/
7+
8+
import actions
9+
10+
from UsesStep uses
11+
where uses.getVersion().regexpMatch("^[A-Fa-f0-9]{40}$")
12+
select uses, "This 'uses' step has a pinned SHA version."

actions/ql/lib/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 0.4.26
2+
3+
### Major Analysis Improvements
4+
5+
* The query `actions/code-injection/medium` has been updated to include results which were incorrectly excluded while filtering out results that are reported by `actions/code-injection/critical`.
6+
7+
## 0.4.25
8+
9+
No user-facing changes.
10+
111
## 0.4.24
212

313
No user-facing changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.4.25
2+
3+
No user-facing changes.

actions/ql/lib/change-notes/2025-11-28-fix-code-injection-alert-filtering.md renamed to actions/ql/lib/change-notes/released/0.4.26.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
---
2-
category: majorAnalysis
3-
---
1+
## 0.4.26
2+
3+
### Major Analysis Improvements
4+
45
* The query `actions/code-injection/medium` has been updated to include results which were incorrectly excluded while filtering out results that are reported by `actions/code-injection/critical`.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
lastReleaseVersion: 0.4.24
2+
lastReleaseVersion: 0.4.26

0 commit comments

Comments
 (0)