Badge image with workflow file path and specific branch?

Is it possible to get the GitHub Actions badge with workflow file path (e.g. .github/workflows/main.yml) and a branch (e.g. main)?

I tried a few combinations:

    This seems to be either not working or working in random manner (the status don’t match the actual status)
    This fails miserably. Instead of showing any image, it only show a page with plain text: “Not Found”.

According to the documentation, it should be:<OWNER>/<REPOSITORY>/actions/workflows/main.yml/badge.svg?branch=main

Note that it’s /actions/workflows as opposed to just /workflows like in your attempt, and that it doesn’t use the full path .github/workflows/main.yml but just the workflow file name main.yml.