Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 16, 2025

The CI/CD workflow was running twice on every PR - once for pull_request and once for push events, since GitHub triggers both when a PR is opened or updated.

Changes

  • Added branch filter to push trigger in .github/workflows/ci-cd.yml to restrict it to main branch only
on:
  pull_request:
  push:
    branches:
      - main
  workflow_dispatch:
  workflow_run:
    workflows: ["Pre-commit fix"]
    types:
      - completed

This ensures:

  • PRs trigger the workflow once via pull_request event
  • Direct pushes to main trigger via push event
  • Manual and workflow dependency triggers remain unchanged
Original prompt

fix these so they dont duplicate thr run on the PR
CI/CD Optimized / Run pre-commit (pull_request)
CI/CD Optimized / Run pre-commit (pull_request)Failing after 30s
CI/CD Optimized / Run pre-commit (push)
CI/CD Optimized / Run pre-commit (push)Failing after 26s


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 16, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@DonnieBLT DonnieBLT marked this pull request as ready for review November 16, 2025 02:49
@github-actions github-actions bot added the files-changed: 0 PR changes 0 files label Nov 16, 2025
@DonnieBLT DonnieBLT added d15 and removed files-changed: 0 PR changes 0 files labels Nov 16, 2025
Copilot AI changed the title [WIP] Fix duplicate runs in CI/CD pre-commit checks Fix duplicate CI/CD workflow runs on pull requests Nov 16, 2025
Copilot AI requested a review from DonnieBLT November 16, 2025 02:53
@DonnieBLT DonnieBLT merged commit 88e4a37 into main Nov 16, 2025
3 checks passed
@DonnieBLT DonnieBLT deleted the copilot/fix-precommit-duplicate-runs branch November 16, 2025 03:15
@github-actions github-actions bot added the unresolved-conversations: 0 PR has 0 unresolved conversations label Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unresolved-conversations: 0 PR has 0 unresolved conversations

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants