Publish in a repo to a specific branch with GitHub Api

Ramiro Ruiz

I'm creating a iOS workflow to publish notes on my repo, it is working quite well but now I want to do it on a branch to keep testing.

I'm exporting the note text and pass the next url:

https://api.github.com/repos/ramiro-ruiz/ramiroruiz.com/contents/content/notes/slug.md

Send the authorization token and a simple commit message.

All this is done on master and to send it to a branch I tried by adding ?ref=my-branch at the end of the url (https://api.github.com/repos/ramiro-ruiz/ramiroruiz.com/contents/content/notes/slug.md?ref=my-branch) but is not working as it keeps publishing to master.

Anyone have an idea of what I'm doing wrong?

VonC

The create or update content API does include a branch parameters, not a ref one.

PUT /repos/:owner/:repo/contents/:path

branch: The branch name. Default: the repository’s default branch (usually master)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Installing specific R package from specific branch from github repo on travis-ci

Get the latest update time of a specific folder in a repo using Github API

React GitHub Repo API

publish only one folder on gitHub on a parallel branch

Different Config Files in GitHub Repo Branch

Having a private branch of a public repo on GitHub?

Github Repo Protected Branch Configuration Not Working

GitHub API Branch Count

How do you install a repo by branch name in a github enterprise repo?

Pushing new files to specific branch in existing repo

Download a specific branch of a github project

Searching code in a specific GitHub branch

GitHub - Create issues specific to a branch?

GET API request to github repo

Is there a way to grab all issues in a specific repo that exclude a certain label using GitHub's API?

Can we publish an existing github repo as nuget package?

How do I publish a local github repo to Visual Studio Services?

Migrate repo from Github to a specific Gitlab group

When Deleting a Branch in Git/Github Is Old Code Still In Repo?

Why is a new branch in our github repo unavailable for checkout?

How to deploy codes to different branch of same repo in github actions?

Github pull request to private repo (from my own branch)

How to load a feature branch from forked GitHub repo into my application?

Git_GitHub Fork only master branch of a repo

Why do we make a new branch when forking a GitHub repo?

Install specific branch from github using Npm

Github deploy only specific features in development branch

How to target specific branch on GitHub issue

Install package with pip from specific branch of github