Using a shared workflow for Copilot coding agent setup steps #170877
|
We've got a working coding agent setup scripts workflow for restoring private dependencies etc. but now we want to convert it to a shared workflow so that we can use and maintain it across many repos. We already do this for our main builds. However, once we move the Copilot setup steps to a shared workflow it no longer gets used when the coding agent session runs, as if it doesn't exist. Hopefully this can be fixed. While we're on feedback we also found that env at the workflow top level didn't work so we had to replicate it in each step of the custom setup steps job |
Replies: 2 comments 5 replies
|
To convert your Copilot setup steps into a shared workflow:Create a Shared Workflow:Store copilot-setup.yml in a private repo (e.g., shared-workflows/.github/workflows/). Reference in Other Repos:In the target repo, create .github/workflows/copilot-setup-steps.yml:yaml Ensure the shared repo’s Settings > Actions > General > Access is set to allow access. Fix Copilot Not Using Shared Workflow:Keep a local copilot-setup-steps.yml in each repo to call the shared workflow, as Copilot may expect setup steps locally. Environment Variables Issue:Top-level env variables may not work with Copilot. Define them at the step level:yaml Alternatively, pass variables as inputs to the shared workflow. If Copilot still doesn’t recognize the shared workflow, verify triggers and permissions or contact GitHub Support via the Support Portal. Share error logs for more specific help! |
|
Hi See the feature request that I have created: https://github.com/orgs/community/discussions/175827 As a workaround, instead of reusing a workflow (that causes error "Calling a reusable workflow with the uses: keyword is not supported in copilot-setup-steps jobs. Please specify the steps directly. "): you can create an action of type "composite" (which is a sequence of steps, see https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action) and use: |
Hi
See the feature request that I have created: https://github.com/orgs/community/discussions/175827
As a workaround, instead of reusing a workflow (that causes error "Calling a reusable workflow with the uses: keyword is not supported in copilot-setup-steps jobs. Please specify the steps directly. "):
you can create an action of type "composite" (which is a sequence of steps, see https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action) and use: