When trying to create a pull request (PR) from a GitHub Actions workflow, you may need to enable the Allow GitHub Actions to create and approve pull requests
option in the repository settings. However, you might encounter the issue where this option is grayed out and cannot be enabled. In this article, I'll share the solution that worked for me.
Solution
The location of the setting varies depending on whether you are using GitHub Enterprise, a GitHub Organization, or neither. Below are the appropriate links to access the settings based on your specific scenario. Replace YOUR_ORG
with your organization's name and YOUR_REPO
with the repository name where your workflow is running.
If you are using GitHub Enterprise
Go to the following link:
https://github.com/enterprises/YOUR_ORG/settings/actionsIf you are using a GitHub Organization
Use this link:
https://github.com/organizations/YOUR_ORG/settings/actionsIf you are not using GitHub Enterprise or an Organization
Go to the repository's settings directly:
https://github.com/YOUR_ORG/YOUR_REPO/settings/actions
In my case, since I was using GitHub Enterprise, I accessed the following link to enable the option:
https://github.com/YOUR_ORG/YOUR_REPO/settings/actions
.
Here’s the updated settings screen:
Top comments (0)