All the tag posts are not being displayed in a loop?

when i run the following code it only displays a single post even though there are multiple posts for the given tag. And its same for all the other tags

{{#foreach posts}}

{{#has tag="#getting-started"}}

Getting Started

{{> “post-card”}}

{{/has}}

{{/foreach}}