Skip to content

Using agentic workflow from an organization .github repo #24961

@ruokun-niu

Description

@ruokun-niu

Hi GH AW team,

First of all, I want to start by saying that GitHub Agentic Workflows is a really useful tool and my team and I have enjoyed using it.

Our team is called Drasi Project and we are currently using an agentic workflow in one of our repositories, drasi-core. We have an issue researcher workflow that gets triggered when an issue on that repository is labeled with needs-research, and the workflow uses the Copilot CLI to conduct some investigation on that topic. Everything works flawlessly.

Now, since we have multiple repositories in our organization, we wanted to see if we could place the agentic workflow definition in a centralized place, such as the .github repository for our organization. After some experimentation, we were finally able to get it working by hosting the agentic workflow (.md and compiled .lock.yml) in the .github repo and using lightweight dispatch workflows in each individual repository that call gh workflow run with --ref against the .github repo when an issue is labeled. The add-comment safe output was configured with target: "*" and allowed-repos to allow the workflow to post comments back to issues in other repositories. You can find an example of the workflow file here: https://github.com/drasi-project/.github/blob/centralized-workflows/.github/workflows/drasi-issue-researcher.md

This flow required three tokens:

  • COPILOT_GITHUB_TOKEN — A personal fine-grained PAT with the Copilot Requests permission, stored in the .github repo. This powers the AI inference engine.
  • ISSUE_UPDATE_TOKEN — A PAT with Issues Read & Write permission on the target repos, stored in the .github repo. This is needed because the default GITHUB_TOKEN is scoped to the .github repo and cannot write comments to issues in other repositories within the org.
  • DISPATCH_TOKEN — A PAT with Actions Read & Write permission on the .github repo, stored as an organization-level secret. This allows the dispatch workflows in other repos to trigger the workflow_dispatch event cross-repo.

I am wondering if you have explored this and if there are any alternative, simpler approaches? Happy to share more information or contribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions