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

Update a file on repository if it already exists #126

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aivuk
Copy link

@aivuk aivuk commented Jul 16, 2017

Check if the file that Staticman is going to create on the repository already exist. If it exists, instead of using createFile from Github lib, get the sha of the existing file and send an updateFile request.

Motivation

We are currently using Staticman for the comments on the http://edulabs.de website. We want to make it possible for the users to suggest new projects for the area edulabs.de/projects, and give to them the possibility of editing it after the project is approved. Each project is going to be a simple markdown file, that is already being created using Staticman. The problem is that when the project file already exist, we would like to create a new pull request updating the file content, instead of creating a new file. This pull request implements this feature.

@weavermedia
Copy link

Can this be fixed and merged? I'm looking for this functionality too.

caiopavanelli pushed a commit to caiopavanelli/staticman that referenced this pull request Aug 17, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants