Ensure this setting is enabled:
Workflow permissions Choose the default permissions granted to the GITHUB_TOKEN when running workflows in this repository. You can specify more granular permissions in the workflow using YAML. Learn more about managing permissions.
Read and write permissions