Enable actions via API for forked repos #104281
Replies: 5 comments
-
|
To enable actions via API for forked repositories in GitHub, you might need to use the GitHub REST API to interact with repository settings. Firstly generate a Personal Access Token: "Developer settings" > "Personal access tokens" and generate a new token with the necessary scopes (e.g., repo or workflow). You'll need to send a curl -X PUT \
-H "Authorization: token YOUR_ACCESS_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/:owner/:repo/actions/enableReplace Note |
Beta Was this translation helpful? Give feedback.
-
|
That is not working, 404 is returned. Permissions are double checked! According to https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/ghes-3.9/ghes-3.9.2022-11-28.yaml there is no such api (therefore i asked this question) |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
It seems running |
Beta Was this translation helpful? Give feedback.
-
|
The following API endpoints enables GitHub Actions on a fork: curl -X PUT \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/OWNER/REPO/actions/permissions \
-d '{
"enabled": true
}' |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
I maintain an organization with a lot of forked repos in it. All repos are public. For forked repos actions are disabled by default as this page says:
I am now looking for an API where I can enable them (the API analogy of pressing the green "I understand my workflows, go ahead and enable them" button). To me it looks like there is no such API :-(
Because I have a lot of repos I don't want to enable all of them via the UI but automate the process. The fork API has also no property like "enable_workflows" but it should have one (with a default value of false).
Doe anyone has a solution or a idea how to solve this?
Beta Was this translation helpful? Give feedback.
All reactions