In the end your credentials need to outlive your CI/CD actions.
From experience, be careful and ensure you properly scope your OIDC connection. It’s very easy to allow ANY GitHub repo with proper OIDC connection bits (SA email, connector pool, etc) to get an OIDC token, rather than what you expect, whether that’s any repo in your private org or a specific single repository. As always, RTFM
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_te...
> Role chaining limits your AWS CLI or AWS API role session to a maximum of one hour.
Even if the attacker had access to env vars from running jobs (which includes the signed token needed to do an OIDC role assumption), those tokens have a short expiry time, and even if an attacker stole that token and performed a role assumption then that session can only be valid for a maximum of 12 hours in AWS, and then you know the attacker is out of your account.
It just significantly reduces, practically nullifies, anything that an attacker can do in your AWS account.
A session token with only a few minutes validity can be enough for someone to make their access permanent.