How to auto-approve workflow execution when Copilot coding agent run? #162826
-
Select Topic AreaQuestion Copilot Feature AreaGeneral BodyI am the repository owner and created an issue. I assigned "Copilot" to that issue and triggered the Copilot coding agent to start. However, when the Copilot coding agent runs, I'm always required to approve its workflow execution. Is there a way to automatically allow workflow execution whenever "I" assign Copilot to an issue? |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 15 replies
-
|
Hey, jumping in here because I’ve noticed the same thing while trying out Copilot’s coding agent on a few repos. Even when the repo owner assigns Copilot to an issue, GitHub still asks for workflow approval. It feels like there should be a way to auto-approve that when the owner initiates it — but I haven’t found any setting that allows it yet. Is this just a default GitHub security policy for all workflow_dispatch events triggered by Copilot, or is there a permission tweak or repo config that can allow trusted auto-approvals in this case? Curious if anyone’s figured out a clean workaround 👀 |
Beta Was this translation helpful? Give feedback.
-
|
It would be great to define which workflows are safe for Copilot to run automatically, such as workflows that run tests. |
Beta Was this translation helpful? Give feedback.
-
|
Currently, there is no way to bypass the required manual approval for a GitHub Actions workflow triggered by GitHub Copilot or any app/bot account, even if you are the repository owner. This approval step is a security measure designed to prevent unauthorized or unintended workflow executions when triggered by automation or external actors. The only workaround is to ensure that the workflow is triggered by a trusted actor (like a personal access token associated with your account) or to run the job manually after approval. GitHub does not provide an option to auto-approve these workflows for bots like Copilot. |
Beta Was this translation helpful? Give feedback.
-
|
This definitely limits the usefulness of the The advantage of this feature would come from being able to avoid the constant copy/paste cycle of moving workflow outputs from GitHub into the IDE and instead be able to work on other things while Copilot re-runs workflows on its own while iterating through fixing errors and attempting to achieve goals, which is exactly why I just went through the trouble of setting it up and trying the feature. Right now, using
comment. 🫤 If the concern really is that the To go a step further, the |
Beta Was this translation helpful? Give feedback.
-
|
You can create a fine grained personal access token for that repo, with permissions Actions: write, and then extend the capabilities of the github mcp server used by the agent in that repo by telling it to use this token, instead of the more limited GITHUB_TOKEN, as described here Tested and working. PS: to find out that actions:write was the needed permission, this part of the docs was key : Also, as a side note, I did not have to add any permission definitions to the workflow yml itself, for this to work. |
Beta Was this translation helpful? Give feedback.
-
|
Are there better alternatives than Copilot Agent? I mean tools which can create PRs which trigger a CI run. I am willing to switch to an alternative (GitLab) , if required. |
Beta Was this translation helpful? Give feedback.
-
|
I will use webhook to auto approve when it's ready and made by copilot again something stupidly done ... |
Beta Was this translation helpful? Give feedback.
-
|
I think the situation should really be improved. Codex, cursor, claude, theta ll simply create PRs that automatically trigger workflows. I would even prefer just having a full «auto approve workflows» setting per repo, as the productivity/risk tradeoff on a private repo with only approved contributors being able to push, is very much in favor of auto running workflows. Please fix !!! |
Beta Was this translation helpful? Give feedback.
-
|
Not a great workaround but you could use a Copilot agent hooks and trigger the CI after the This workaround is working for me, obviously not great and hopefully temporary. |
Beta Was this translation helpful? Give feedback.
-
|
you done??? |
Beta Was this translation helpful? Give feedback.
-
|
What we ended up using is a custom JavaScript action to |
Beta Was this translation helpful? Give feedback.
-
|
You can use an agent hook to send a repository dispatch event. That event can tell a downstream workflow which PR the agent is working on. Then you can create a separate GitHub Actions workflow to receive that event and automatically approve the PR or perform other follow-up actions. It is better to use a |
Beta Was this translation helpful? Give feedback.
-
|
I don't know how new this setting is, but under the Project Settings -> Copilot -> Coding agent, there is now a toggle switch: Require approval for workflow runs: When Copilot pushes changes, require approval from a maintainer with write access before Actions workflows are run. Allowing GitHub Actions workflows to run without approval may allow unreviewed code written by Copilot to gain write access to your repository or access your GitHub Actions secrets. The recommended value is On obviously, but you can disable this to autorun the workflows for the Copilot. I'm not really worried of Copilot itself, but I'm wondering is it possible that an outsider opens a PR to my repo, and somehow manages to trigger Copilot. If I understand correctly, you can add a new workflow in a PR that can do pretty much anything, and I'm wondering could that workflow be triggered via Copilot. |
Beta Was this translation helpful? Give feedback.

It is part of Github's security risk mitigation, as the Github Action workflow doesn't have the same firewall restriction as Github Copilot Agent environment.
Ref: https://docs.github.com/en/copilot/using-github-copilot/coding-agent/about-assigning-tasks-to-copilot#risk-copilot-can-push-code-changes-to-your-repository