Multiple simultaneous deployments

When you create github actions that auto deploy new features and you have an approval required attached to a branch, and this approval takes some time. when you have a feature that’s waiting for it’s approval and meanwhile another feature action job gets started. How does github or how can i prevent missing features or non approved features from being deployed?

I’ve not tested any of this yet, since our organisation does not have the highest payment plan, but when thinking about it i’m concerned about these points:

example:
When a PR is merged and the feature gets deployed and it’s approven and there are other features approven earlier but those features are merged later, does the later approved feature remove the earlier deployed feature while deploying? (because the later approved feature’s branch doesnt contain the other feature)

I think i’m missing something but i’m not getting how it’s safe to wait for deployments since the branch could be ahead or behind when deploying something “old”

One thing you could do is implement a branch protection rule that requires you be up to date with the latest code. This ensures that if your main branch has changed, you have done a pull from the main branch and integrated it before a PR can be approved.

That’s indeed a really helpful thing, but when you are deploying on a push to a branch let’s say “main”
And there is a environment protection rule with a required reviewer it’s going to deploy the “main” in that state right?
And if it’s deploying the branch in that state there could be another PR/merge to that branch later that is approved earlier.
And then the new feature also containing the old feature because it’s also on the main branch is deployed.

Even if you deploy on a PR approve with that env protection the other PR is already merged but not deployed and will also get deployed

You could use concurrency to ensure only the most recent deployment out of main can proceed: GitHub Actions: Limit workflow run or job concurrency | GitHub Changelog