Apparently, I forgot to specify the environment in which the secrets were held, in the workflow.
jobs: test: runs-on: ubuntu-latest # added the following line environment: "production"
Problem fixed!