Why Travis CI cannot read any public commits from GitHub? - github

For exmaple I have a public repository datetime_tag_helper with a .travis.yml file. I visit https://travis-ci.org/swordray/datetime_tag_helper , sign in and turn on building option. The page shows There are no builds for this repository. and blank Build History / Pull Requests / Branch Summary.

I think your GitHub repository isn't building because your.travis.yml is invalid. It looks like you want to build with Ruby version 2, in which case your .travis.yml should look like this:
language: ruby
rvm:
- 2.1.0
You can read up more about ruby on travis-ci here.

Related

Make GitHub extract repo settings from a file

Is there a way to set repo settings inside a file so that GitHub displays them on the main page?
Input (e.g. .github.yaml in main branch)
Output (repo main page)
meta_data: description: JDK main-line development website: https://openjdk.org/projects/jdk topics: [ java, jvm, openjdk ]
I'm looking for an answer without calling GitHub APIs.
I'm looking for an answer without calling GitHub APIs.
And yet, a call to updating a repository API would certainly be involved, through a GitHub Action.
You can setup such an action triggered only by your file, in the main branch:
on:
push:
branches: ['main']
paths: ['.github.yaml']
And use directly a gh repo edit -d '...' call, since the GitHub CLI I is preinstalled on all GitHub-hosted runners.
That way, each time you modify the .github.yaml file, you can regenerate the About message on your repository.

How to publish docusaurus website at username.github.io

I have been learning how to use Docusaurus to make markdown documentation websites recently.
My exact questions are:
How do I have to name the repository
What do I have to change in this config: https://i.stack.imgur.com/4WAhY.png
What branch do I need for what?
My goal is to create a site at ruixey.github.io, not at ruixey.github.io/REPO_NAME/
Thanks in advance for any help
Docusaurus side
Everything I can see looks correct according to the documentation Docusaurus provides:
Deploying to GitHub Pages | Docusaurus.
It states the following about which branch is used:
GitHub Pages picks up files from the default branch (master/main) or the gh-pages branch ...
and for deploying to the GH Page:
We provide a docusaurus deploy command
GitHub Pages side
Regarding your repository name, I recommend you to read the documentation that GitHub provides on Pages, which goes over the naming conventions when setting up a self-titled GitHub Pages deployment: Creating a GitHub Pages site
These docs say the following about choosing a repository name:
If you're creating a user site, your repository must be named <user>.github.io ...
If your user name contains uppercase letters, you must lowercase
the letters.
Source: Creating a repository for your site
Have you tried to deploy with your current configuration file? I don't see a reason why it should fail.
What do I have to change in this config
Assuming your repo URI is something like: git#github.com:Ruixey/roblox.git
organizationName: 'Ruixey', // Usually your GitHub org/user name.
projectName: 'roblox', // Usually your repo name.
// git#github.com:Ruixey/roblox.git <-- your ssh URI
// ^ ^
// organizationName projectName
What branch do I need for what?
main for your source, when you deploy, docusaurus will push to gh-pages branch, if the branch does not exist, this creates it.
$ USE_SSH=true yarn deploy

How do I programatically download the ZIP file for a GitHub repo's default branch?

I'm writing a PHP script that lets users enter a GitHub owner & repo name, and then it downloads a zip file from that repo.
GitHub allows linking directly to the download of the latest release for a repo: /owner/name/releases/latest/download/name.zip (see https://docs.github.com/en/free-pro-team#latest/github/administering-a-repository/linking-to-releases). So if a repo has a release, that works fine.
However, for repos without a release, I want to download from the default branch instead. GitHub provides a link for this (green 'Code' button > 'Download ZIP'), but that URL includes the branch name: /owner/name/archive/[BRANCH].zip.
Is there a way to link directly to the download for the latest branch without knowing what the branch might be called? For example, something like this hypothetical URL: /owner/name/archive/latest.zip
You would need to read the default branch of the repository first through GitHub API (See Get Repository)
Once you have the default branch, you can use it to complete your download URL
curl -L http://github.com/<user>/<repo>/archive/<branch>.zip --output <branch>.zip
Unless you need the default branch name for something, you can do this in one call.
https://api.github.com/repos/<user>/<repo>/zipball

Moving my public NPM package from Bitbucket to Github

I like Bitbucket better than Github, but sadly there's only very few options for continuous integration for Bitbucket.
The packages in question are written by me, and are currently hosted on Bitbucket:
https://www.npmjs.com/package/grunt-asset-compress
https://www.npmjs.com/package/node-file-parser
I want these to be moved to Github, without breaking anything. I am afraid changing the repository data is not enough.
"repository": {
"type": "git",
"url": "https://StephanBijzitter#bitbucket.org/skelware/grunt-asset-compress.git"
},
Image a user has version 1 installed, which is hosted on Bitbucket.
I then change the version to 2 and change the URL to the Github URL.
I proceed to push, to both Github and Bitbucket.
If the user updates, he will be updating to version 2, which by now includes the URL of Github.
I push some more fixes and release version 3 on Github, the user updates again and everything is fine.
However, what if the user did not update to version 2, before version 3 was released? NPM will probably try to download version 3 from Bitbucket as that is what the URL points to in version 1!
I do not want to keep the repositories in sync; I want to be able to make the Bitbucket repository private at one point to hide it from public view while the Github repository would then serve on its own.
What are the steps I need to take to be able to move to Github, without breaking the update system for the (albeit limited) users of my packages?
Just got a reply from NPM itself:
Hi, Stephan.
Thanks for the question. I'm hoping I can help...if I'm understanding
your inquiry correctly.
What ever you publish to npm is held within our own repository and
that is what's served to a user when they install your package. The
inclusion of the repository url, bitbucket or github, is more
informational as opposed to functional. Regardless of when you push
changes to github, the user that installs your package will get your
latest publish to npm. In other words, those two things may be in
different states and at different versions.
Please let me know if I'm off base. I'll be here to help. Ernie
In other words, for all I care I could remove the Bitbucket repository entire and nothing will break, as a copy is hosted on their servers which is served to everyone downloading it through NPM.
Thank you, Ernie!

how to serve my own gitbook using github pages

I've created my own gitbook. looks good locally.
but how shall I integrate it into my github pages? Similar issues here difficulty-in-getting-gitbook-site-to-show-up-in-github-page
I tried that approach as well, but I have problem setting the grunt up, and I also I would like to do that myself before using an integrated tool.
I tried to copy the generated _book folder to my github page folder, but that didn't workout as there are some encoding issues
Similar question here
I had this question because I don't understand github pages, the underlying steps involve
build the _book folder, this is the static content that will be served
create gh-pages branch copy the _book folder content into gh-pages
github will then serve the content
the command gitbook publish will finish all 3 steps. but I am not familiar with grunt as well , as npm install . is a pre-step.