Skip to content

Using agentic workflow from an organization .github repo #24961

Closed

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.

Activity

  1. locked and limited conversation to collaborators on Apr 6, 2026
  2. unlocked this conversation on Apr 6, 2026
  3. pelikhan commented on Apr 6, 2026

    @pelikhan
    Collaborator
  4. ruokun-niu commented on Apr 6, 2026

    @ruokun-niu
    Author

    Thanks! Giving this a try

  5. locked and limited conversation to collaborators on Apr 6, 2026
  6. unlocked this conversation on Apr 6, 2026
  7. pelikhan commented on Apr 7, 2026

    @pelikhan
    Collaborator

    Send us feedback!

  8. ruokun-niu commented on Apr 7, 2026

    @ruokun-niu
    Author

    Hi, this might be a stupid question, but I am wondering if you can guide me on how to test the AW from a fork. I am following the CentralRepoOps guide and I have set up the orchestrator workflow in my organization's .github repo, and the worker workflow in my personal fork. When I tried to trigger the workflow by labelling an issue in the fork repo, I got the following error:

    Run ${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default
    Error: None of the following secrets are set: COPILOT_GITHUB_TOKEN
    The GitHub Copilot CLI engine requires either COPILOT_GITHUB_TOKEN secret to be configured.
    
    Common causes if the secret appears to be configured:
      - Organization secrets must have repository access granted
      - Environment secrets require the job to specify that environment
      - Secret names are case-sensitive - verify exact spelling
    
    Documentation: 'https://github.github.com/gh-aw/reference/engines/#github-copilot-default'
    Error: Process completed with exit code 1.

    This is a bit confusing as I have this secret set in both my personal fork and in the organization .github repo

  9. locked and limited conversation to collaborators on Apr 7, 2026
  10. unlocked this conversation on Apr 7, 2026
  11. ruokun-niu commented on Apr 7, 2026

    @ruokun-niu
    Author

    Ok, I think this was just due to me trying to trigger via a fork. I was able to resolve it when I switched to test on a repo that is in the organization

  12. locked and limited conversation to collaborators on Apr 7, 2026
  13. unlocked this conversation on Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions