How can I detect pending workflow enablement on a fork when the permissions API returns enabled: true?
#211109
Replies: 2 comments
|
I think the key point here is that It would be helpful to know if GitHub exposes this initial enablement state through a separate read-only API or CLI command. Otherwise, it’s difficult to reliably check the status without changing anything. Since the Actions page and API response appear to disagree, I think this is worth clarifying with GitHub. A documented way to check the pending state would be really useful for automation. |
|
There is no documented read-only field for the fork banner. The two calls you ran measure different things.
The only documented marker for that gate is the per-workflow Your fork does not carry it, yet the gate is visible in the data:
One of my own forks looks the same (2 Read-only check that works today: gh api repos/muescha/lsp4ij --jq '.fork'
gh api 'repos/muescha/lsp4ij/actions/workflows?per_page=100' --jq '[.workflows[].state] | unique'
gh api 'repos/muescha/lsp4ij/actions/runs?per_page=1' --jq '.total_count'
On your third question: the API not reflecting the banner while |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
💬 Feature/Topic Area
API
Body
Hi,
I’m trying to check, using the GitHub CLI or API, whether workflows have been enabled on my forked repositories. I want to read their current status without changing any settings or triggering workflow runs.
For one of my public forks, the API response and the Actions page appear to disagree.
Repository: https://github.com/muescha/lsp4ij
Actions page: https://github.com/muescha/lsp4ij/actions
When I open the Actions page while signed in as the repository owner, GitHub displays:
The page also displays the button “I understand my workflows, go ahead and enable them.”
However, this read-only API request:
returns:
{ "enabled": true, "allowed_actions": "all", "sha_pinning_required": false }According to the documentation for Get GitHub Actions permissions for a repository, this endpoint includes whether GitHub Actions is enabled.
The individual workflow states also do not seem to expose the restriction:
All eight workflows return
active; none returnsdisabled_fork.I found this comment in discussion #104281, which suggests enabling Actions on a fork by calling
PUT /repos/{owner}/{repo}/actions/permissionswith{"enabled": true}.My question concerns the read-only counterpart:
GETon that same endpoint already returnsenabled: true, even though the Actions page still asks me to enable workflows on the fork.I have deliberately not clicked the enablement button or tried the suggested
PUTrequest, because I want to preserve the current state for investigation. The enablement prompt is visible in my authenticated owner view; I understand that other visitors may not see the same page.My questions are:
enabled: truemean when the Actions page still says that workflows are not being run?I’m specifically looking for a way to read the current state. Enabling Actions would change the setting rather than let me detect whether the initial enablement is still pending.
Thanks!
All reactions