Skip to content

Commit 949fc37

Browse files
authored
Merge pull request #21211 from smowton/smowton/fix/long-actions-expressions
Actions: tolerate long `${{ ... }}` expressions
2 parents 075041f + a326ce3 commit 949fc37

21 files changed

+1014
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: fix
3+
---
4+
* Fixed a crash when analysing a `${{ ... }}` expression over around 300 characters in length.

actions/ql/lib/codeql/actions/ast/internal/Ast.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ string getADelimitedExpression(YamlString s, int offset) {
2727
// not just the last (greedy match) or first (reluctant match).
2828
result =
2929
s.getValue()
30-
.regexpFind("\\$\\{\\{(?:[^}]|}(?!}))*\\}\\}", _, offset)
31-
.regexpCapture("(\\$\\{\\{(?:[^}]|}(?!}))*\\}\\})", 1)
30+
.regexpFind("\\$\\{\\{(?:[^}]|}(?!}))*+\\}\\}", _, offset)
31+
.regexpCapture("(\\$\\{\\{(?:[^}]|}(?!}))*+\\}\\})", 1)
3232
.trim()
3333
}
3434

actions/ql/test/library-tests/.github/workflows/commands.yml renamed to actions/ql/test/library-tests/basic/.github/workflows/commands.yml

File renamed without changes.

actions/ql/test/library-tests/.github/workflows/expression_nodes.yml renamed to actions/ql/test/library-tests/basic/.github/workflows/expression_nodes.yml

File renamed without changes.

actions/ql/test/library-tests/.github/workflows/many_strings.yml renamed to actions/ql/test/library-tests/basic/.github/workflows/many_strings.yml

File renamed without changes.

actions/ql/test/library-tests/.github/workflows/multiline.yml renamed to actions/ql/test/library-tests/basic/.github/workflows/multiline.yml

File renamed without changes.

actions/ql/test/library-tests/.github/workflows/multiline2.yml renamed to actions/ql/test/library-tests/basic/.github/workflows/multiline2.yml

File renamed without changes.

actions/ql/test/library-tests/.github/workflows/poisonable_steps.yml renamed to actions/ql/test/library-tests/basic/.github/workflows/poisonable_steps.yml

File renamed without changes.

actions/ql/test/library-tests/.github/workflows/shell.yml renamed to actions/ql/test/library-tests/basic/.github/workflows/shell.yml

File renamed without changes.

actions/ql/test/library-tests/.github/workflows/test.yml renamed to actions/ql/test/library-tests/basic/.github/workflows/test.yml

File renamed without changes.

0 commit comments

Comments
 (0)