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.
Related
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.
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).
I have an organization here: https://github.com/casbin/. I have setup the organization's GitHub pages to this repo: https://github.com/casbin/casbin.github.io and bound the domain: casbin.org to it.
Now I want to build a new GitHub pages from this repo: https://github.com/casbin/casbin-gui-editor and publish it to a custom sub-path: casbin.org/editor. But when I enable GitHub pages in: https://github.com/casbin/casbin-gui-editor, GitHub directly publishes it to: http://casbin.org/casbin-gui-editor/ instead. See the below screenshot:
I want it to be published to casbin.org/editor instead of casbin.org/casbin-gui-editor. But I didn't find a place to modify it. I attempted to modify the below Custom domain input box but it doesn't allow me to specify a sub-path like casbin.org/editor.
I know I can finally solve this issue by renaming my repo to the sub-path I want, but it makes my repo name obscure. So I'd still like to find other ways. Any other ways to do it?
I am integrating travis-ci and I need to include the url to the build status points to my fork.
If I create a PR, they will have to change README.md and redirect that.
[![Build Status](https://travis-ci.org/FORK_USER/PROJECT.svg?branch=master)](https://travis-ci.org/FORK_USER/PROJECT)
How do I replace FORK_USER with something that works once the PR is merged?
You can't. Github markdown simply does not have any placeholder functionality for repos, users, etc. It's been a feature request for a long time too.
I was hoping that I could display a nice download button on my WordPress site to a GitHub repository and include the version number in the text, eg: "Download (v1.2)" but am unsure as to where I can pull that version data from on the public side.
If nothing else, last commit date or something would be helpful too.
Thanks
You can use the published GitHub API to access commit information. For example, you can get a commit object and use that to populate your download link. If a commit is not appropriate, you could get a tag or a blob and extract the information you want out of that.