Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 25, 2025

The "Release And Push" workflow job was appearing in PR checks despite being skipped, causing confusion. It should only run after PR merge to master.

Changes

Added github.ref == 'refs/heads/master' condition to restrict the release job to master branch pushes:

release-and-push:
  name: Release And Push
  runs-on: ubuntu-latest
  # Before: if: github.repository == 'casbin/caswaf' && github.event_name == 'push'
  if: github.repository == 'casbin/caswaf' && github.event_name == 'push' && github.ref == 'refs/heads/master'
  needs: [ frontend, backend]

The same condition was applied to the Docker login and push steps for consistency.

Impact

  • PRs will no longer show this job in their checks
  • Job only executes on master branch pushes (post-merge)
Original prompt

This section details on the original issue you should resolve

<issue_title>[bug] needs to fix CI for strange check</issue_title>
<issue_description>In this open PR: #96, it runs this check:

failing checks
[Build / Release And Push (push)](https://github.com/casbin/caswaf/actions/runs/18801540259/job/53649846097?pr=96)
Build / Release And Push (push)Failing after 35s

I think for an open state PR, it should not run "Build / Release And Push (push)", 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)


💡 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.

@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.

@nomeguy nomeguy marked this pull request as ready for review October 25, 2025 10:08
Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI to prevent builds on open PRs Fix CI: Restrict release-and-push job to master branch only Oct 25, 2025
Copilot AI requested a review from nomeguy October 25, 2025 10:10
Copilot finished work on behalf of nomeguy October 25, 2025 10:10
@nomeguy nomeguy changed the title Fix CI: Restrict release-and-push job to master branch only feat: fix CI: restrict release-and-push job to master branch only Oct 25, 2025
@nomeguy nomeguy merged commit 208e418 into master Oct 25, 2025
9 of 11 checks passed
@github-actions
Copy link

🎉 This PR is included in version 1.57.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] needs to fix CI for strange check

3 participants