Skip to content

Commit b2f6ef2

Browse files
author
Alvaro Muñoz
authored
Merge pull request #78 from github/rasmuswl/syntax-error-query
2 parents ac7b7b7 + 2f68e6f commit b2f6ef2

File tree

5 files changed

+27
-0
lines changed

5 files changed

+27
-0
lines changed

ql/src/Debug/SyntaxError.ql

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @name Syntax error
3+
* @description A piece of code could not be parsed due to syntax errors.
4+
* @kind problem
5+
* @problem.severity recommendation
6+
* @id actions/syntax-error
7+
* @tags reliability
8+
* correctness
9+
* language-features
10+
* debug
11+
* @precision very-high
12+
*/
13+
14+
private import codeql.actions.ast.internal.Yaml
15+
16+
from YamlParseError pe
17+
select pe, pe.getMessage()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
on: pull_request_target
2+
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- run: echo ${{ github.event.pull_request.body}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| .github/workflows/malformed.yml:7:4:7:4 | expected <block end>, but found '<block sequence start>' | expected <block end>, but found '<block sequence start>' |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Debug/SyntaxError.ql
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
semmle-extractor-options: --tolerate-parse-errors --experimental

0 commit comments

Comments
 (0)