This thread is trying to answer question "How can one automate Playwright tests with Azure authentication that requires MFA, especially when running headless on GitHub Actions?"
You can't really automate MFA authentication. Most likely you'll need to login manually and save session storage for further testing https://playwright.dev/docs/auth#session-storage
See this https://dumbitdude.com/how-to-automate-microsoft-mfa-using-playwright/ if can help
@janagar - If you are looking for some starter code you can check out https://github.com/rajyraman/playwright-azure-ad-mfa. I looked into this problem as well.
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].