Skip to content

Commit d14f439

Browse files
committed
Add explanation for suffix(2)
1 parent 658a065 commit d14f439

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • actions/ql/lib/codeql/actions/ast/internal

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,15 @@ class UsesStepImpl extends StepImpl, UsesImpl {
14591459
)
14601460
}
14611461

1462+
/**
1463+
* Gets the callable name for a `$/xyz` self-call. The `$/` prefix identifies the repository of
1464+
* the enclosing composite action and is not part of the action path.
1465+
*
1466+
* The argument to `suffix` is a zero-based start offset. In the two-character `$/` prefix, `$`
1467+
* is at offset 0 and `/` at offset 1, so `suffix(2)` starts at the first character of the
1468+
* repository-relative action path. For example, `$/.github/actions/leaf` becomes
1469+
* `.github/actions/leaf`, and `$/action` becomes `action`.
1470+
*/
14621471
private string getSelfCallableName() {
14631472
exists(CompositeActionImpl action, string owner, string repo, string requested_ref |
14641473
action = this.getEnclosingCompositeAction() and

0 commit comments

Comments
 (0)