Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: check force push #430

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

daixiang0
Copy link
Member

@daixiang0 daixiang0 commented Feb 26, 2025

Commit Message

Add a check for force push in CI.

Related Issues/PRs (if applicable)

Fixes #429

@daixiang0 daixiang0 requested a review from a team as a code owner February 26, 2025 05:20
@daixiang0
Copy link
Member Author

Example: daixiang0#2

Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

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

I would like to see three changes :

  • Do not check when the PR is draft
  • Do not fail the workflow even if the force push is detected.
  • Instead, put a bot comment on the PR

@daixiang0 daixiang0 marked this pull request as draft February 27, 2025 02:03
@daixiang0 daixiang0 force-pushed the force-push branch 2 times, most recently from 137028c to e123676 Compare February 27, 2025 04:24
Add a check for force push in CI.

Signed-off-by: Loong <[email protected]>
@daixiang0 daixiang0 marked this pull request as ready for review February 27, 2025 06:05
@daixiang0
Copy link
Member Author

Example: daixiang0#3

Skip draft and WIP as well.

Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

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

thanks, looking good! one last request: would it be possible to delete the previous comment if exists?

with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const comment = "Force push detected. Please read CONTRIBUTION.md and do not force push unless DCO issue.";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const comment = "Force push detected. Please read CONTRIBUTION.md and do not force push unless DCO issue.";
const comment = "We’ve detected a force push. Please review the [contribution guidelines](https://github.com/envoyproxy/ai-gateway/blob/main/CONTRIBUTING.md), and avoid force pushing unless you’re addressing a DCO issue after marking your PR as ready for review."


on:
pull_request_target:
types:
Copy link
Member

Choose a reason for hiding this comment

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

i am not that knowledgeable but opened, edited and ready_for_review are necessary? synchrnize seems enough but not sure

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.

Add a job in pr_style_check.yaml to check force pushes
2 participants