Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support uploading to a specific branch #2

Closed
2 tasks
rajbos opened this issue Aug 17, 2021 · 2 comments
Closed
2 tasks

Support uploading to a specific branch #2

rajbos opened this issue Aug 17, 2021 · 2 comments

Comments

@rajbos
Copy link
Contributor

rajbos commented Aug 17, 2021

Currently all files are uploaded to the default branch, as that is what the GitHub API uses by default. I want to pass in a parameter indicating the branch name to use for uploading the file.

As a requirement I'd say that the branch already has to exist. Creating it is not necessary for me.

Changes needed

  • Add an optional parameter to the action to specify the branch name
  • Add the extra parameter to the PUT call in upload.js, see documentation

data: {
message: commitMessage,
sha,
content: base64Content
}
}).then(({ data }) => {

I'd be happy to help working on this :-)

@LasyIsLazy
Copy link
Owner

I'd be thankful if you can make a PR for this.
Additional, There may be several points to note:

  • What will the GitHub API do if the branch is not existed?
  • Which structure should we use for the extra parameter to the PUT call?

@rajbos rajbos mentioned this issue Aug 20, 2021
@rajbos
Copy link
Contributor Author

rajbos commented Aug 20, 2021

I'd say create the branch if it doesn't exist yet. Currently the upload just fails with a non-descriptive error. Will see if I can add that as well, maybe tomorrow.

See the progress here #5

LasyIsLazy pushed a commit that referenced this issue Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants