Skip to content

build(ci): drop github-slug-action, compute short SHA inline - #2388

Open
LoneRifle wants to merge 1 commit into
huggingface:mainfrom
opengovsg:build/ci/no-image-slug
Open

build(ci): drop github-slug-action, compute short SHA inline#2388
LoneRifle wants to merge 1 commit into
huggingface:mainfrom
opengovsg:build/ci/no-image-slug

Conversation

@LoneRifle

@LoneRifle LoneRifle commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Problem

rlespinasse/github-slug-action is dependent on other actions from its author, namely, rlespinasse/slugify-value and rlespinasse/shortify-git-version. Notably, the underlying actions are referenced by version tag, not by commit hash.

Not only does this mean the action has a significant footprint, it is also susceptible to supply-chain attacks through the version tagging of malicious actions, even by commit pinning rlespinasse/github-slug-action, since it does not pin the underlying actions.

Given that the action is only used to populate one particular env var, it might make sense to replace it with shell cmds.

Solution

Replace rlespinasse/github-slug-action with inline shell to compute the 7-char short SHA, removing a CI supply-chain dependency.

  • build-image and deploy-prod use ${GITHUB_SHA:0:7} (the auto-injected default env var, no template interpolation)
  • deploy-dev keeps the shell approach off github.event.pull_request.head.sha, since on pull_request triggers GITHUB_SHA is the merge commit, not the PR head

Replace the third-party rlespinasse/github-slug-action with inline shell
to compute the 8-char short SHA, removing a CI supply-chain dependency.

build-image and deploy-prod use ${GITHUB_SHA:0:7} (the auto-injected
default env var, no template interpolation). deploy-dev keeps the shell
approach off github.event.pull_request.head.sha, since on pull_request
triggers GITHUB_SHA is the merge commit, not the PR head.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LoneRifle
LoneRifle force-pushed the build/ci/no-image-slug branch from 469fa8e to 124c1d5 Compare June 28, 2026 10:31
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.

1 participant