---
name: "Parallel-safety audit on PR (command)"
description: >-
  Re-audits the changed MSTest tests of a pull request for parallel-safety when
  a maintainer comments `/parallel-audit`.

# The automatic on-open / on-synchronize variant lives in
# `parallel-safety-audit.md`. They must remain separate workflows because
# mixing `slash_command` with other triggers makes gh-aw's activation gate
# always require a command-position match, silently skipping the agent on every
# non-comment event.
on:
  slash_command:
    name: parallel-audit
    events: [pull_request_comment]
    strategy: centralized
  roles: [admin, maintainer, write]
  reaction: "eyes"

permissions:
  contents: read
  pull-requests: read
  copilot-requests: write

imports:
  - shared/parallel-safety-audit-shared.md

safe-outputs:
  report-failure-as-issue: false
  messages:
    footer: "> 🤖 **Automated content by GitHub Copilot.** Generated by the [{workflow_name}]({agentic_workflow_url}) workflow.{ai_credits_suffix} · [◷]({history_link})"
  noop:
    report-as-issue: false

concurrency:
  # The slash command dispatches as workflow_dispatch, where
  # github.event.issue.number is empty — falling back to an empty group would
  # collapse every dispatched run into one bucket and cancel unrelated PRs'
  # audits. Resolve the PR number from aw_context when the issue number is
  # absent so each PR gets its own concurrency group.
  group: parallel-safety-audit-${{ github.event.issue.number || fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number }}
  cancel-in-progress: true

timeout-minutes: 20
---

<!-- Body provided by shared/parallel-safety-audit-shared.md -->
