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

Added Validation Workflow for Pull Request Content #1233

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

Conversation

abhayymishraa
Copy link
Contributor

@abhayymishraa abhayymishraa commented Jan 2, 2025

What kind of change does this PR introduce?

Issue Number:

Screenshots/videos:
Screenshot from 2025-01-03 02-46-46
Screenshot from 2025-01-03 02-46-55

If relevant, did you update the documentation?
N/A

Summary
This pull request introduces a GitHub Actions workflow that checks for essential information in pull requests. It ensures that contributors link relevant issues, answer key questions about their changes, and complete the checklist before submission. This enhancement aims to streamline the review process and improve communication regarding changes made in pull requests

  • I have tested it many times looking forward for any improvements
  • Everything is commented for the better understanding

Does this PR introduce a breaking change?
No, this PR does not introduce any breaking changes. It adds a new validation workflow without affecting existing functionality.

@abhayymishraa abhayymishraa requested a review from a team as a code owner January 2, 2025 21:47
Copy link

github-actions bot commented Jan 2, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview c28a3e3

Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (5114356) to head (c28a3e3).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1233   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          373       373           
  Branches        94        94           
=========================================
  Hits           373       373           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aialok
Copy link
Member

aialok commented Jan 4, 2025

@abhayymishraa, can we test this here?
If you remove some items from the checklist, will it comment here?

Good job 🚀

@abhayymishraa
Copy link
Contributor Author

yes @aialok would i make a try by not providing the issue

@aialok
Copy link
Member

aialok commented Jan 4, 2025

yes @aialok would i make a try by not providing the issue

Yes, lets try it. Just edit the PR body.

@abhayymishraa
Copy link
Contributor Author

Sure @aialok

@abhayymishraa
Copy link
Contributor Author

abhayymishraa commented Jan 4, 2025

@aialok test is failing but the issue is i don't know why the comment is not appearing
but when i tried to do it for the first time it worked and now failing its working fine on my forked repo

@aialok
Copy link
Member

aialok commented Jan 4, 2025

Basically, to add a comment when a pull request is created, edited, opened etc....you should use the pull_request_target event instead of pull_request. The pull_request_target event runs on the base branch and has the necessary permissions to write comments. Just change the event to pull_request_target, and it should work.

https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request_target

@abhayymishraa
Copy link
Contributor Author

sure @aialok i'll do it rn

@abhayymishraa
Copy link
Contributor Author

abhayymishraa commented Jan 4, 2025

@aialok and now it's not running that workflow ??.. but its working fine in the local so should i make a new pr or leave it.. just this would be enough

@abhayymishraa
Copy link
Contributor Author

@aialok i did a rebase on both the commit thought the test will run . I think a new pr will be a great option .
what do you think about it ?

@aialok
Copy link
Member

aialok commented Jan 6, 2025

@abhayymishraa
The pull_request_target event will not run until this PR is merged.

This is because it executes with respect to the code on the base branch, and currently, the required code is not present on the base branch.

I am currently occupied with some work.

If you have tested this in your repository, you can attach the PR link. I will review it and get back to you.

@abhayymishraa
Copy link
Contributor Author

@aialok
This is the PR Link -> Link

I have tested all the outcomes what will happen when a the body is not provided alongside with the PR. This test case will be failed .
Also one more feature is there if the issue failed . it will label the issue as "need help" and then if the body validation succed it will remove that need help

  • Screenshot from 2025-01-08 23-32-12
  • Screenshot from 2025-01-08 23-32-21

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.

✨ Enhancement: Automate PR body validation with issue link and placeholder questions
2 participants