Skip to content

Commit 2300af1

Browse files
committed
Add actions.lock extraction
Teach the JavaScript extractor to classify .lock files as YAML while limiting default autobuild extraction to explicitly included paths. Expose Actions lockfiles through the ActionsLock QL class and cover extraction with a normal QL test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4994bb27-c5ca-47e9-b082-cfc1ca244e86
1 parent e7181b3 commit 2300af1

98 files changed

Lines changed: 152 additions & 102 deletions

File tree

Some content is hidden

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

actions/extractor/tools/autobuild-impl.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ $DefaultPathFilters = @(
99
'include:.github/reusable_workflows/**/*.yml',
1010
'include:.github/reusable_workflows/**/*.yaml',
1111
'include:**/action.yml',
12-
'include:**/action.yaml'
12+
'include:**/action.yaml',
13+
'include:**/actions.lock'
1314
)
1415

1516
if ($null -ne $env:LGTM_INDEX_FILTERS) {

actions/extractor/tools/autobuild.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ include:.github/reusable_workflows/**/*.yml
1414
include:.github/reusable_workflows/**/*.yaml
1515
include:**/action.yml
1616
include:**/action.yaml
17+
include:**/actions.lock
1718
END
1819
)
1920

actions/ql/lib/actions.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
import codeql.actions.Ast
2+
import codeql.actions.Lock
Lines changed: 5 additions & 0 deletions
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* Provides classes for working with GitHub Actions lockfiles.
3+
*/
4+
5+
private import codeql.actions.ast.internal.Yaml
6+
7+
/** An `actions.lock` file. */
8+
class ActionsLock extends YamlDocument {
9+
ActionsLock() { this.getFile().getBaseName() = "actions.lock" }
10+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
on: push
2+
jobs:
3+
test:
4+
runs-on: ubuntu-latest
5+
steps:
6+
- run: echo test
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file is machine-generated by `gh actions-lock`.
2+
# Do not edit by hand; run `gh actions-lock` to update.
3+
# Docs: https://gh.io/actions-lockfile
4+
version: 'v0.0.2'
5+
workflows:
6+
'.github/workflows/test.yml':
7+
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
8+
- 'github/codeql-action@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28'
9+
dependencies:
10+
'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1':
11+
ref: '3d3c42e5aac5ba805825da76410c181273ba90b1'
12+
commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
13+
owner_id: 44036562
14+
repo_id: 197814629
15+
'github/codeql-action@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28':
16+
ref: 'v4.37.8'
17+
commit: 'sha1-db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28'
18+
owner_id: 9919
19+
repo_id: 259445878
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| actions.lock:0:0:0:0 | actions.lock |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import codeql.actions.Lock
2+
3+
from ActionsLock lock
4+
select lock.getFile()

cpp/ql/src/Best Practices/Exceptions/CatchingByValue.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void good() {
4343
<li>C++ FAQ: <a href="https://isocpp.org/wiki/faq/exceptions#what-to-throw">
4444
What should I throw?</a>, <a href="https://isocpp.org/wiki/faq/exceptions#what-to-catch">
4545
What should I catch?</a>.</li>
46-
<li>Wikibooks: <a href="https://en.wikibooks.org/wiki/C%2B%2B_Programming/Exception_Handling#Throwing_objects">
46+
<li>Wikibooks: <a href="http://en.wikibooks.org/wiki/C%2B%2B_Programming/Exception_Handling#Throwing_objects">
4747
Throwing objects</a>.</li>
4848

4949

0 commit comments

Comments
 (0)