fix: drop invalid merged activity type from close-preview template - #26
Merged
Conversation
`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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
close-preview.ymldeclared:mergedis not a validpull_requestactivity type. GitHub's list has no such type; a merge is delivered asclosedwithgithub.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 fixThe job body is unconditional — it runs
lightdash stop-preview --name ${GITHUB_HEAD_REF##*/}with noif: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:
close-preview.yml:6:21: invalid activity type "merged" for "pull_request" Webhook eventThe
.github/actionlint.yamlentry 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