Skip to content

fix(action): run bundled install.sh at pinned ref instead of main#118

Merged
Connorrmcd6 merged 1 commit into
Connorrmcd6:mainfrom
laurigates:claude/upstream-issue-pr-k4utfi
Jun 14, 2026
Merged

fix(action): run bundled install.sh at pinned ref instead of main#118
Connorrmcd6 merged 1 commit into
Connorrmcd6:mainfrom
laurigates:claude/upstream-issue-pr-k4utfi

Conversation

@laurigates

@laurigates laurigates commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

What

The composite action.yml installed surf by piping the installer from the main branch:

run: curl --proto '=https' --tlsv1.2 -fsSL https://raw.githubusercontent.com/Connorrmcd6/surface/main/install.sh | sh

This PR runs the copy of install.sh bundled at the pinned action ref instead:

run: sh "${{ github.action_path }}/install.sh"

Why

A consumer who pins the action to an immutable commit SHA for supply-chain reasons —

- uses: laurigates/surface@<sha>   # v0.6.2

— still had the installer script fetched from main at run time. A change (or compromise) of
main therefore reached every pinned consumer, so the SHA pin did not actually pin what runs.
(The old line also fetched cross-repo from Connorrmcd6/surface, decoupling the installer from
the action ref entirely.)

Because the action repository is already checked out at the pinned ref when the composite action
runs, install.sh exists locally at ${{ github.action_path }}. Running that copy pins the
installer to the same ref as the action.

Behavior

No change for latest consumers — the env-driven SURF_VERSION / SURF_INSTALL_DIR flow is
unchanged. This is defense-in-depth: install.sh already checksum-verifies the download
(fail-closed), and this closes the remaining gap by pinning the installer script itself.

A consumer pinning the action by commit SHA still had the composite action
fetch install.sh from raw.githubusercontent.com/.../main, so a change to
main reached every pinned consumer. The action repo is already checked out
at the pinned ref, so install.sh exists locally at ${{ github.action_path }};
run that copy so the installer script is pinned alongside the action.
@laurigates laurigates marked this pull request as ready for review June 14, 2026 07:41

@Connorrmcd6 Connorrmcd6 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! LGTM

@Connorrmcd6 Connorrmcd6 merged commit 3acb4ae into Connorrmcd6:main Jun 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants