ghupload is a tool to upload files to a GitHub repository. It is a command line
tool that can be used in scripts or in a CI environment. It allows you to upload
directly via the GitHub API without having to git clone
&& git commmit
&&
git push
for a simple file upload.
You will need a GitHub token. You can create one in your GitHub account settings.
Then you can use it like this:
ghupload upload --token <token> file1 dir/ dir2/ owner/repo@branch:dir/
- dirs are uploaded recursively
- it doesn't handle synchronization, so deletion need to be manual.
The token can be specified in the environment variable GHUPLOAD_TOKEN
. You can
specify a pass entry to get the token from
there if you prefix with pass::
:
# this will grab the value from github/token `pass` entry
export GHUPLOAD_TOKEN=pass::github/token
- You can omit to specify a branch, it will grab the default branch from your
repository (i.e:
master
,main
) - You can specify a commit message with the
--message
option. If you don't specify one, a default one will be used. - You can specify a commit author with the
--author
option. If you don't specify one, it will try to get the value from your git config. - You can specify an author email with the
--email
option. If you don't specify one, it will try to get the value from your git config.
Go to the release page and choose your archive or package for your platform.
brew tap chmouel/ghupload https://github.com/chmouel/ghupload
brew install ghupload
go install github.com/chmouel/ghupload@latest
Chmouel Boudjnah <@chmouel>