Visitar URL original
Actions: Add new models for external actions/workflows by JarLob · Pull Request #22263 · github/codeql · GitHub
Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add explanation for suffix(2)
  • Loading branch information
JarLob committed Aug 4, 2026
commit d14f439e95a36ead0bf156c8b498bb831140a498
9 changes: 9 additions & 0 deletions actions/ql/lib/codeql/actions/ast/internal/Ast.qll
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,15 @@ class UsesStepImpl extends StepImpl, UsesImpl {
)
}

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