Skip to content

Use hooks.post.install_steps for the cask quarantine step - #512

Merged
joe4dev merged 1 commit into
mainfrom
devx-1124-cask-install-steps
Oct 23, 2026
Merged

joe4dev merged 1 commit into
mainfrom
devx-1124-cask-install-steps

Conversation

@joe4dev

@joe4dev joe4dev commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Motivation

#510 works around Homebrew's deprecated postflight by writing the stanza through custom_block, at two costs: {{staged_path}} has to be escaped past GoReleaser's own template pass, and the stanza renders at the top of the cask, so every stanza after it trips Cask/StanzaOrder. #511 has to skip that cop to stay green.

GoReleaser v2.19.0 (released 2026-10-22, via goreleaser/goreleaser#6873) adds the first-class option, which removes all three.

Solution

Replace custom_block with hooks.post.install_steps, using GoReleaser's new .StagedPath field in place of the escape. Behaviour is unchanged — the step still clears quarantine on the whole staged dir, as #477 made it.

hooks:
  post:
    install_steps: |
      on_macos do
        run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{ .StagedPath }}"]
      end

Also drops #511's --except-cops=Cask/StanzaOrder and its TODO(#512), and bumps the GoReleaser pin.

Validation

Ran the released GoReleaser 2.19.0 against this config:

  • goreleaser check passes; 2.18.2 rejects it with field install_steps not found in type config.HomebrewCaskHook, so an unbumped pin fails loudly rather than dropping the hook
  • make check-cask passes: .StagedPath renders to Homebrew's {{staged_path}} token
  • the stanza renders in its proper position, so make lint-cask (brew style + brew audit) reports no offences with no exception

Earlier, against #6873's pre-release build: the generated stanza was byte-identical to #510's, and Homebrew 7.0.4 loaded it as Cask::Artifact::PostflightSteps with no deprecation warning.

The install itself was verified on #510 for the identical stanza: quarantine cleared across all 43 staged files, and lstk --version runs.

Docs

Nothing to document. No change to lstk's commands, flags, env vars or output, and no user-visible change to the cask's behaviour — this swaps the mechanism that generates an identical stanza.

Review

Human review advised: it touches the release pipeline. Both CI and the release job install GoReleaser from .tool-versions, so they move to 2.19.0 together.

Towards DEVX-1124
Closes DEVX-1130

🤖 Generated with Claude Code

@joe4dev joe4dev added semver: patch docs: skip Pull request does not require documentation changes labels Sep 22, 2026
@joe4dev
joe4dev force-pushed the devx-1124-cask-install-steps branch from bc70c3a to ba7d03d Compare September 22, 2026 10:12
@joe4dev
joe4dev force-pushed the devx-1124-guard-generated-homebrew-cask branch 2 times, most recently from 75fb741 to dd3f443 Compare September 22, 2026 10:39
@joe4dev
joe4dev force-pushed the devx-1124-cask-install-steps branch from ba7d03d to 3170663 Compare September 22, 2026 10:41
@joe4dev
joe4dev force-pushed the devx-1124-guard-generated-homebrew-cask branch from dd3f443 to be579b7 Compare September 22, 2026 10:46
@joe4dev
joe4dev force-pushed the devx-1124-cask-install-steps branch from 3170663 to 476ffc4 Compare September 22, 2026 10:47
@joe4dev
joe4dev force-pushed the devx-1124-guard-generated-homebrew-cask branch from be579b7 to 607b035 Compare September 22, 2026 12:56
@joe4dev
joe4dev force-pushed the devx-1124-cask-install-steps branch from 476ffc4 to 7e5504e Compare September 22, 2026 12:57
@joe4dev
joe4dev force-pushed the devx-1124-guard-generated-homebrew-cask branch from 607b035 to 260bb75 Compare September 22, 2026 14:02
Base automatically changed from devx-1124-guard-generated-homebrew-cask to main September 23, 2026 14:59
@joe4dev
joe4dev force-pushed the devx-1124-cask-install-steps branch from 7e5504e to 6dd83e0 Compare October 23, 2026 07:47
Co-Authored-By: Claude <noreply@anthropic.com>
@joe4dev
joe4dev force-pushed the devx-1124-cask-install-steps branch from 6dd83e0 to a5a5f8f Compare October 23, 2026 09:55
@joe4dev
joe4dev marked this pull request as ready for review October 23, 2026 10:32
@joe4dev
joe4dev requested review from a team and peter-smith-phd as code owners October 23, 2026 10:32
@joe4dev
joe4dev merged commit 2345bf3 into main Oct 23, 2026
21 checks passed
@joe4dev
joe4dev deleted the devx-1124-cask-install-steps branch October 23, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: skip Pull request does not require documentation changes semver: patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants