Github API - create contents api method not triggering GitHub Pages build - ruby-on-rails

I'm working on a Rails app that allows users to publish datasets via Github and access it via GitHub pages. I'm using the Github API to act as the user, create a repo and add the files, and everything works as expected, the only issue is that the GitHub pages page build doesn't seem to be happening. The datasets can be downloaded, but trying to access the index.html page doesn't seem to work at all.
Here's an example repo:
https://github.com/git-data-publisher/Foo
And here's the Github pages site:
http://git-data-publisher.github.io/Foo/
You can see that, for example:
http://git-data-publisher.github.io/Foo/data/June_2014.csv
Works fine.
I can only guess that this means the GitHub pages build isn't getting triggered. Any way I can make this happen without having to do a manual Git push?
You can also see my code here if this helps:
https://github.com/theodi/git-data-publisher

Github tries to parse you site as a Jekyll site.
You must indicate that you're not using Jekyll by creating an empty .nojekyll file at the root of your repository.

Related

How to access source code from within Docker build?

I'm trying to build a Github Action that's going to take a screenshot of the Github Pages website (built with Jekyll) and allow the user to upload it as an artifact. For my convienience and since installing Pyppeteer is non-trivial, I wrapped the thing around in Docker. Here's the source code for the action at the time of writing the question:
https://github.com/hakierspejs/jekyll-screenshot-github-action/tree/8569f1370c5decf5ecfb4bc17a977cad5aa3d2aa
The problem is in accessing the source code of the Github Pages website. I noticed that Github Actions is mapping a couple of directories as a volume, but neither /github/workflow nor /github/workspace seems to contain the source code. Is there a path I could mount to somehow access it?
/github/workflow is the right path, but I was missing a actions/checkout#master step. Adding this line to the list of steps made it work:
- uses: actions/checkout#master

Have Lighthouse generate report using custom template

Is it possible to have Lighthouse export using custom HTML template instead of the templates provided in Lighthouse?
I was thinking there may be a way like Basic Custom Audit Recipe.
I'm thinking the code for the template logic is here.
If you switch to the gh-pages branch you can see that the report viewer is a unique animal by itself in a folder located at /viewer/. Here are the steps to reproduce:
Fork the repository at Github
In the settings of the repository, follow the instructions in the GitHub Pages section to publish your GitHub Pages site.
Edit and customize the index.html to your needs and commit.
Run a Lighthouse report and save it as a Gist.
Load that report in your new, customized viewer at https://GITHUB_USERNAME.github.io/GITHUB_REPOSITORY_NAME/viewer/?gist=GITHUB_GIST_ID

Bootstrap typeahed multiple values. Fork?

I read here https://github.com/twitter/bootstrap/pull/2007 that it was opened a pull request for adding support for multiple selections in Typeahead. I don't understand github, pull requests very well, so I wonder where I can find this updated js file?
I work in Rails
The repository that contains the code you are looking for is https://github.com/codeimpossible/bootstrap
How pull requests work
Pull requests are sent by someone (in this case codeimpossible) to the original owner of a forked repository. That means that codeimpossible has a version of the bootstrap repository https://github.com/codeimpossible/bootstrap whereas twitter's original original repository is https://github.com/twitter/bootstrap.
With the pull request he is asking them to merge his changes back into their repository (and subsequent new versions of twitter bootstrap. If the pull request is successful (follow the comment thread on that page to the end!) you will eventually get the code from twitters repository.
In this case however, the pull request was not accepted and you will only find the code on https://github.com/codeimpossible/bootstrap

Setting up git commit hook for Redmine

I am trying to migrate the setup here at the office from SVN to Git and am setting up Redmine as the host for our projects and issue management (Currently we use a version of Gforge + SVN). I should preface by saying that I'm an embedded C software developer by day and have basically zero experience with Rails or web apps, but I like trying new things so I volunteered to set up the project management tools which will take us into the future.
I have Redmine setup and am using Gitolite as the Git repo manager. Additionally, I am using the ericpaulbishop/redmine_git_hosting plugin to facilitate automatic public ssh key pushing to Gitolite and automatic repo creation when we register a new project. Everything seems to work except the repo view within the project does not keep track of the changesets. (The "History" is just empty, although when you view the files, it does show the latest version correctly)
I copied the post-receive hook from the plugin's contrib directory to the .gitolite/ common hooks, but again I know little about Ruby and how these gitolite hooks work so I don't know how to debug this. I notice there are log messages and things in the hook, but I have no idea where those are printed, etc...
I even tried the Howto on the Redmine wiki, HowTo setup automatic refresh of repositories in Redmine on commit:
#!/bin/sh
curl "http://<redmine url>/sys/fetch_changesets?key=<your service key>"
Any ideas on where I start debugging? I've been able to resolve every problem up to this point, but I'm a little stuck now. The plugin doesn't make it obvious how this is supposed to work, and to be honest, I'm not even sure if this is a problem with Redmine not reading the repo correctly (or at all), or gitolite not communicating as Redmine expects, etc...
I guess I could answer this...
I checked the issues under the Github page and I found this on:
https://github.com/ericpaulbishop/redmine_git_hosting/issues/89
Which was pretty much exactly my problem. This does appear to be a small bug in the plugin, but you can work around it by changing Max Cache Time to "1 minute or until next commit". This immediately fixed my problem. I simply left it like that but one of the posters claimed that you could change it back to until next commit and it works from then on...

Bitbucket: How to create a list of issues from multiple repositories?

We have several repositories on BitBucket. For every repository we
have the issue tracker enabled. For our progress reports I would like
to be able to see all issues from all related repositories in one
overview.
Is this possible and how can it be done?
Thanks,
Paul
Bitbucket has an API. You could quickly put together a script (or webpage using JSONP) calling:
https://api.bitbucket.org/1.0/repositories/USERNAME/REPOSITORY/issues/
for each repository? (Replacing USERNAME and REPOSITORY with appropriate values)
For something more advanced you could query the USER, get all their repositories, then iterate.
I needed the same thing today so I made the following python script available here on github.
The two API call URLs you need are
https://bitbucket.org/api/1.0/user/repositories/
https://bitbucket.org/api/1.0/repositories/{owner}/{slug}/issues/
You'll have to authenticate with your BitBucket credentials which I did using the python requests library:
response = requests.get(url, auth=HTTPBasicAuth(_USERNAME, _PASSWORD))

Resources