diff --git a/.github/workflows/cogni-ai-agent.yml b/.github/workflows/cogni-ai-agent.yml index 1f6e52b..f9156a7 100644 --- a/.github/workflows/cogni-ai-agent.yml +++ b/.github/workflows/cogni-ai-agent.yml @@ -46,6 +46,22 @@ on: description: Prompt for the agent required: true type: string +# Prevent concurrent runs on the same branch to avoid push conflicts. +# When a new run is triggered, it will queue until the previous pending run completes. +# On the default branch each run gets a unique group (github.run_id) so runs can +# proceed in parallel, since each one branches off to its own new branch. +# This logic assumes the workflow is triggered only by issue/PR-related events or branches +# (and will fall back to github.run_id otherwise) to ensure correct grouping. +# See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency +concurrency: + cancel-in-progress: false + group: >- + cogni-ai-agent-${{ + (github.event.issue.pull_request && github.event.issue.number) + || github.event.pull_request.number + || (github.ref_name != github.event.repository.default_branch && github.ref) + || github.run_id + }} jobs: cogni-ai-agent: name: Run Cogni AI agent diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 2059089..e24be7f 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -1,5 +1,5 @@ --- -# GitHub Copilot cloud agent customizaton. +# GitHub Copilot cloud agent customization. # name: Copilot Setup Steps # yamllint disable-line rule:truthy