-
Notifications
You must be signed in to change notification settings - Fork 262
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 a validation check for pr approval in the deploy-pr workflow #660
Added a validation check for pr approval in the deploy-pr workflow #660
Conversation
Hey @Spiral-Memory, I have worked on this vulnerablity which btw was difficult to find out and finally I have found the fix after researching. I have tested using my other github account, you can also test it here for better clearence https://github.com/devanshkansagra/Embedded-Chat . Also please review this pull request |
Awesome work @devanshkansagra Will discuss about this with you today. |
Okay sure. Then let's finish up this as early as possible coz this was very long time awaited |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still carries the same vulnerability as discussed.
Hey @Spiral-Memory, I have removed the part of transfering pr number as artifact and instead I have used github api to fetch the pr number in deploy-pr workflow |
You can check and review whenever you are free |
Awesome work @devanshkansagra Is it working ? |
Yes @Spiral-Memory, this workflow is working. You can check it out here in my test repo https://github.com/devanshkansagra/Embedded-Chat by raising a demo pr This is based on the thing I researched on the internet and various AIs including ChatGPT, Github-Copilot etc. also I haven't gone in depth regarding this Github-API, and jq stuff and same goes with the checking approval status |
No, what i am asking is, with this, it will check the PR permission for the first PR in the list, not the PR it is triggered on, have you tested this ? |
Yea I have tested it by raising two different prs in parallel |
Okay then tomorrow, we will see how exactly is it working and then will merge it if testing succeeds. |
Okay No problem |
Hey you are right, yesterday I ran the approval check was shown the respective pr numbers but today I have tested very parallel, it was checking the top of the list pr number |
Hey @Spiral-Memory, I have pushed the commit, you can check / review it |
Hey @Spiral-Memory, I have one thing to ask, in |
No not just that, it also tests if project is getting built correctly after the new change so it shouldn't break the project |
ohh okay |
One thing to share, I have observed currently that if you merge/close/approve multiple prs at same time or the small time diff then pages-build workflow will be skipped, this is currently there |
To overcome this let the workflow get's fully completed then approve / merge next pr |
That's Okay... Apart from that, is it good to merge this? |
Yea sure, you can go for it |
But how it can cause, during this research I didn't got any this type of error, I have the duplicated the exact things and created a dummy test repo |
That's fine @devanshkansagra Before reverting, let me atleast test that if it is working or not (ignoring security alert) |
Okk |
Hi @devanshkansagra or you will add a fix soon ? |
You made me sweaty in winters after showing me that security alert error. Currently it is more secure than before, so I will add that fix in my next pr |
This new change is something causing deploy error too |
I need to revert this change, let me know once you test it well and working fine |
This Pull request adds an additional pr approval check in
deploy-pr.yml
workflow. This adds validation to ensure the deploy-pr workflow runs only after PRs are approved by collaborators or owners. The GitHub API is used to verify approval status, preventing unauthorized deployments from forked repositories.Acceptance Criteria fulfillment
deploy-pr
workflowVideos/Screenshots
N/A