Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 10 additions & 1 deletion automation/source-repo-templates/api-docs.cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,17 @@ jobs:
steps:
- name: Resolve ref metadata
# Single source of truth for the ref this run documents.
#
# The ref is routed through env: instead of being inlined via
# ${{ }}. Inlining at template-expansion time would interpolate
# the raw string into the shell literal, so a tag name with a
# single quote (Git allows it) could break out of the quoted
# context. Env indirection keeps user-controlled data on the
# variable side of the shell parser, where it cannot escape.
env:
REF_RAW: ${{ inputs.ref || github.ref_name }}
run: |
raw='${{ inputs.ref || github.ref_name }}'
raw="$REF_RAW"
raw="${raw#refs/tags/}"
raw="${raw#refs/heads/}"
slug="${raw//\//-}"
Expand Down
11 changes: 10 additions & 1 deletion automation/source-repo-templates/api-docs.dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,17 @@ jobs:
# workflow_dispatch can pass an alternate ref via inputs.ref;
# fall back to github.ref_name (already stripped of refs/...).
# DOCS_REF_SLUG is branch-safe for use in PR/branch names.
#
# The ref is routed through env: instead of being inlined via
# ${{ }}. Inlining at template-expansion time would interpolate
# the raw string into the shell literal, so a tag name with a
# single quote (Git allows it) could break out of the quoted
# context. Env indirection keeps user-controlled data on the
# variable side of the shell parser, where it cannot escape.
env:
REF_RAW: ${{ inputs.ref || github.ref_name }}
run: |
raw='${{ inputs.ref || github.ref_name }}'
raw="$REF_RAW"
raw="${raw#refs/tags/}"
raw="${raw#refs/heads/}"
slug="${raw//\//-}"
Expand Down
11 changes: 10 additions & 1 deletion automation/source-repo-templates/api-docs.python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,17 @@ jobs:
# workflow_dispatch can pass an alternate ref via inputs.ref;
# fall back to github.ref_name (already stripped of refs/...).
# DOCS_REF_SLUG is branch-safe for use in PR/branch names.
#
# The ref is routed through env: instead of being inlined via
# ${{ }}. Inlining at template-expansion time would interpolate
# the raw string into the shell literal, so a tag name with a
# single quote (Git allows it) could break out of the quoted
# context. Env indirection keeps user-controlled data on the
# variable side of the shell parser, where it cannot escape.
env:
REF_RAW: ${{ inputs.ref || github.ref_name }}
run: |
raw='${{ inputs.ref || github.ref_name }}'
raw="$REF_RAW"
raw="${raw#refs/tags/}"
raw="${raw#refs/heads/}"
slug="${raw//\//-}"
Expand Down
11 changes: 10 additions & 1 deletion automation/source-repo-templates/api-docs.typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,17 @@ jobs:
# fall back to github.ref_name (already stripped of refs/...).
# DOCS_REF_SLUG is branch-safe for use in PR/branch names
# (`@resq-sw/ui@v0.35.6` → `resq-sw-ui-v0.35.6`).
#
# The ref is routed through env: instead of being inlined via
# ${{ }}. Inlining at template-expansion time would interpolate
# the raw string into the shell literal, so a tag name with a
# single quote (Git allows it) could break out of the quoted
# context. Env indirection keeps user-controlled data on the
# variable side of the shell parser, where it cannot escape.
env:
REF_RAW: ${{ inputs.ref || github.ref_name }}
run: |
raw='${{ inputs.ref || github.ref_name }}'
raw="$REF_RAW"
raw="${raw#refs/tags/}"
raw="${raw#refs/heads/}"
slug="${raw//\//-}"
Expand Down
Loading