Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

The workflow triggered on both push and pull_request events, causing duplicate runs for PRs from same-repo branches.

Changes

  • Restrict push trigger to master branch only
  • Keep pull_request trigger for all PRs (same-repo and forks)

Before:

on: [push, pull_request]

After:

on:
  pull_request:
  push:
    branches:
      - master

PRs now show one set of checks instead of two (main / test (^16) (pull_request) + main / test (^16) (push)).

Original prompt

This section details on the original issue you should resolve

<issue_title>[bug] needs to fix CI for strange duplicated checks in PR</issue_title>
<issue_description>The following duplicated CI checks ran in this open PR: #80

[main / test (^16) (pull_request)](https://github.com/node-casbin/mongoose-adapter/actions/runs/20065374084/job/57554620685?pr=80)
main / test (^16) (pull_request)Failing after 17s
[main / test (^16) (push)](https://github.com/node-casbin/mongoose-adapter/actions/runs/20065372994/job/57554620333?pr=80)
main / test (^16) (push)Failing after 17s
[main / test (^18) (pull_request)](https://github.com/node-casbin/mongoose-adapter/actions/runs/20065374084/job/57554620683?pr=80)
main / test (^18) (pull_request)Failing after 17s
[main / test (^18) (push)](https://github.com/node-casbin/mongoose-adapter/actions/runs/20065372994/job/57554620339?pr=80)
main / test (^18) (push)Failing after 20s

I think for an open state PR, it should not run "XXX (push)" checks, right? It should run for the git push after PR merge?
Need to fix the CI.</issue_description>

Comments on the Issue (you are @copilot in this section)

@hsluoyz @nodece @Shivansh-yadav13

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@hsluoyz
Copy link
Member

hsluoyz commented Dec 9, 2025

@nodece @Shivansh-yadav13 please review

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@hsluoyz hsluoyz marked this pull request as ready for review December 9, 2025 15:11
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI for strange duplicated checks in PR Fix duplicate CI runs on pull requests Dec 9, 2025
Copilot AI requested a review from hsluoyz December 9, 2025 15:16
@hsluoyz hsluoyz changed the title Fix duplicate CI runs on pull requests feat: fix duplicate CI runs on pull requests Dec 9, 2025
@hsluoyz hsluoyz merged commit 2c5e010 into master Dec 9, 2025
9 of 11 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 9, 2025
# [5.5.0](v5.4.0...v5.5.0) (2025-12-09)

### Features

* fix duplicate CI runs on pull requests ([#83](#83)) ([cd799f7](cd799f7))
* upgrade CI scripts' Node.js version to 20 and 22 ([#85](#85)) ([ed25ea8](ed25ea8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] needs to fix CI for strange duplicated checks in PR

3 participants