Recently we've started using the github pull request templates to provide more info about the code being checked in.
Since there is a template one can see the progress, which is basically the number of fields filled in the PR template.
It is something like:
My question is, is there an API to analyze the same? Or is there a bot that does the same? Gives me the progress of the fields of the PR template?
You can start with the v3/pulls/reviews/ API
GET /repos/:owner/:repo/pulls/:number/reviews
That will list the reviews for a given PR (not PR template though, so you might have to create one artificially).
Related
I have created a github repo and deployed a simple HTML, CSS and JS website on it.
I want to create a github bot to automatically filter the pull request on the following basis:
If only the JS file is changed then the pull request is valid else it is invalid
Is it really possible to do that?
Thanks a lot for your help 😊
You could use a GitHub Action for that.
For instance, banyan/auto-label applies label based on file type.
In your case, fork that repository, and make your own GitHub Action in order to reject the PR if you detect a file whose extension is not the one set in your action.
A rejection ("mergeability of PR") can involve status check policy.
Github release the draft PR a while ago.
I have a normal PR and I wanted to change that to a draft PR. How can I do that?
Update - Now Available - Jan 2020
Convert Default → Draft
This is possible now, with an option below "Reviewers" section in PR.
See: Feature Request: Switch from ready to draft in pull requests
Convert Draft → Default
To answer #marsandback comment Draft PR --> PR, just click the Ready for review
The feature is now available!
See: Feature Request: Switch from ready to draft in pull requests
You can't change now, but you can follow the feature request from GitHub Community:
Feature Request Switch from ready to draft in pull requests
Although as this answer is created you currently can't change the stage of a normal pull request into a draft. However, You can prefix the pull request with [WIP] e.g:
[WIP] Allow changing stage of an open pull request to draft.
It is pretty common in open source to claim an issue this way.
Check contributing guidelines on the repository incase they have specific guidelines to follow.
Here is mediawiki guidelines for code contribution
https://www.mediawiki.org/wiki/Developer_Wishlist/2017/Code_Contribution_(Process,_Guidelines,_etc.)
As it's been pointed out, this is possible by going to the pull request itself. Under the reviewers section on the right, look for the text: "Still in progress? Convert to draft", where "convert to draft" is a hyperlink. Click on it, confirm, and it's done.
See screenshot in the documentation.
Can convert to draft under the reviewers section.
I wanted to fix some typos in a Microsoft documentation repo. I clicked on its New pull request button. That resulted in the following page being displayed:
As you can see, the green Create pull request button is disabled. How do I proceed from here? In other repos (such as for Amazon documentation), the process works differently, and I am able to directly create a pull request.
The common scenario of making such PRs looks like the following:
fork the repository http://prntscr.com/m7yhq0
make a new branch there with name like fix/several-typos http://prntscr.com/m7ytis
change a file and commit your changes to the branch (there should not be any difficulties)
go to the original repository, click New pull request and choose compare across forks http://prntscr.com/m7yih0
select necessary branches for PR and then the button Create pull request will be enabled.
Review your changes displayed below and click Create pull request
Hope that will help.
I've already made Jenkins test the pull request and post the result( success or fail ) like this.
Developers can click the Details button, and it will open jenkin's page to display the error messages.
However, I want to directly display the error message on the github instead of check on the jenkin's page.
Is there any way to achieve that?
If I need to tell more information, please let me know.
Update
I add Github PR post comment in Post build task like this. The column of Content is default, I'm not sure it's correct or not.
But I didn't see the comment after the jenkins retest, did I set the configuration wrongly?
Finally, I choose to post error message directly at comment via python and Github API
And I used this script https://gist.github.com/rmcgibbo/3433798, it's really useful.
Is there some way to get an RSS feed for one's github stars list?
I want to get it into Pinboard via IFTTT.
The current answer here gives the stars as JSON rather than RSS. Here's how I get my GitHub stars through the IFTTT RSS service:
Use the "New feed item matches" trigger
Enter your GitHub user RSS feed:
https://github.com/csu.atom
Set the "Keyword or simple phrase" that IFTTT will use to match items to:
[your username] starred
For example, my filter is set to csu starred (the word "starred" alone would probably work, but then the trigger might also fire on some false positives, like if a repository name or something else includes the word "starred").
Add whatever action you want to happen whenever this trigger fires. The link to the starred repository is in the {{EntryUrl}} variable and the title is in {{EntryTitle}}.
Your Github stars are available in JSON at a URL like this: https://api.github.com/users/username/starred (sub in your own username of course)
I found this Yahoo! Pipes thing to turn your stars into an RSS feed.
The Yahoo Pipes service has shut down, and IFTTT apparently dropped the stars trigger from their Github channel. So I went and created the same thing in my own Huginn instance, using a Website Agent and a Post Agent.
IFTTT now has this option. All you have to do is create a recipe.
Just put the "New Starred Repository" for THIS. And then do the appropriate steps for Pinboard for THAT.
EDIT
So apparently it might not work anymore, maybe, however on browsing the recipies I found this, which probably does work so try it, just remember to edit it for your github username
I've combined the SiftRSS service (https://siftrss.com/) with https://github.com/username.atom activity feed the OP mentioned. On SiftRSS I filter the activity feed with a /\bstarred\s\w+\/\w+/ regex on the title attribute. Works flawlessly but is dependend on a third party service, if one needs to self-host, I would also recommend using Huginn as #larcher already mentioned.