Skip to content

fix: drop invalid merged activity type from close-preview template - #26

Merged
charliedowler merged 1 commit into
mainfrom
feature/prod-10126
Aug 13, 2026
Merged

fix: drop invalid merged activity type from close-preview template#26
charliedowler merged 1 commit into
mainfrom
feature/prod-10126

Conversation

@charliedowler

Copy link
Copy Markdown
Contributor

What

close-preview.yml declared:

on:
  pull_request:
    types: [closed, merged]

merged is not a valid pull_request activity type. GitHub's list has no such type; a merge is delivered as closed with github.event.pull_request.merged == true.

This is one of the templates customers copy into their own repositories — it is the teardown that stops Lightdash preview projects when a PR closes.

Why types: [closed] is the complete fix

The job body is unconditional — it runs lightdash stop-preview --name ${GITHUB_HEAD_REF##*/} with no if: gate on merge status. So tearing the preview down on any close, merged or abandoned, is both the current behaviour and the desired one. Dropping the invalid token changes nothing about what the workflow does.

Worth noting the fix is safe regardless of an ambiguity I could not resolve: GitHub's docs do not state whether an unknown activity type is ignored or invalidates the trigger. If ignored, this is dead-syntax cleanup. If it invalidates, every customer using this template has a preview teardown that never fires and preview projects accumulating silently. The one-line change is correct either way, so it did not seem worth blocking on the answer.

Verification

Found by the actionlint CI added in #25, which flagged it on its first run. Confirmed both directions locally:

  • Pre-fix, no ignore listclose-preview.yml:6:21: invalid activity type "merged" for "pull_request" Webhook event
  • Post-fix, with the baseline entry removed → clean across all six templates

The .github/actionlint.yaml entry that was suppressing this as tracked debt is deleted in this PR, restoring the linter's signal on that file. The ShellCheck advisories remain baselined as accepted style noise.

Not covered

Existing customers hold their own copies of this template; this fix only reaches new adopters and anyone who re-syncs.

Linear: PROD-10126

`merged` is not a valid `pull_request` activity type — GitHub delivers a
merge as `closed` with `github.event.pull_request.merged == true`. The
template is copied verbatim into customer repositories, where it is the
teardown for Lightdash preview projects.

The job body is unconditional (`lightdash stop-preview` on any close), so
`types: [closed]` is behaviour-identical and complete: previews are torn
down whether the PR was merged or abandoned, which is the intent.

Also removes the corresponding entry from the actionlint baseline, which
was suppressing this as tracked debt. actionlint is now clean on the
templates without it.

Linear: PROD-10126
@charliedowler
charliedowler merged commit 2782078 into main Aug 13, 2026
3 checks passed
@charliedowler
charliedowler deleted the feature/prod-10126 branch August 13, 2026 22:49
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