Skip to content

Add Copilot auto-fix workflow for dependabot PRs#19508

Merged
majastrz merged 1 commit into
mainfrom
copilot/add-github-action-fix-tests
Jun 26, 2026
Merged

Add Copilot auto-fix workflow for dependabot PRs#19508
majastrz merged 1 commit into
mainfrom
copilot/add-github-action-fix-tests

Conversation

Copilot AI commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Dependabot PRs that break tests or land with merge conflicts require manual intervention. This workflow automates prompting GitHub Copilot to handle both cases.

What's added

.github/workflows/copilot-auto-fix.yml — two jobs:

  • fix-failing-tests — fires on workflow_run completion (Build, failure) for any dependabot/* branch. Resolves the associated open PR, deduplicates by scanning existing comments for the run ID, then posts a @copilot comment with repo-specific guidance:

    • Baseline regeneration (dotnet test -- --filter TestCategory=Baseline --test-parameter SetBaseLine=true)
    • Unit/integration test failure triage
    • npm/TypeScript compatibility checks for vscode-bicep / vscode-bicep-ui
  • fix-merge-conflicts — fires on pull_request events from dependabot[bot]. Polls mergeStateStatus (10 s intervals, up to ~100 s) until GitHub resolves mergeability, then posts a @copilot comment on DIRTY PRs asking it to resolve conflicts while preserving dependabot's version bumps. Deduplicates to avoid repeat comments on re-sync.

Microsoft Reviewers: Open in CodeFlow

Agent-Logs-Url: https://github.com/Azure/bicep/sessions/c3bf4e81-3452-4699-a931-6fb97149e548

Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
@github-actions

github-actions Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Test this change out locally with the following install scripts (Action run 28270038837)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 28270038837
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 28270038837"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 28270038837
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 28270038837"

Please investigate and fix the failing tests so this PR can be merged. Failed run: $RUN_URL

Things to consider for this repo:
- **Baseline tests** – if snapshot/baseline files are out of date, regenerate them with

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we point this part to a script? One of these two will do it:

This way if the command changes (due to test framework shenanigans or anything else really), this will continue working.

@majastrz majastrz merged commit d27fb6e into main Jun 26, 2026
43 of 44 checks passed
@majastrz majastrz deleted the copilot/add-github-action-fix-tests branch June 26, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants