question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It is possible to update a current file?

See original GitHub issue

I am trying to update a post that I created with staticman for my jekyll site.

Here is my config.

editaddons:
  allowedFields:
    [
      'title',
      'body',
      'curselink',
      'wowilink',
      'websitelink',
      'gitlink',
      'image',
      'status',
      'categories',
      'editorsname',
      'editreason',
    ]
  branch: 'develop'
  commitMessage: 'Edit Addon'
  format: 'frontmatter'
  generatedFields:
    date:
      type: date
    slug:
      type: slugify
      options:
        field: title
    layout: addon
    draft: false
  filename: '{fields.slug}'
  moderation: true
  name: 'xxxxxxxxsic.com'
  path: '_addons'
  requiredFields: ['title', 'body', 'editorsname', 'editreason']
  transforms:
    email: md5
    body: 'frontmatterContent'

And the error I am getting when trying to overright the same file.

{  
   "success":false,
   "rawError":{  
      "message":"{\"message\":\"Invalid request.\\n\\n\\\"sha\\\" wasn't supplied.\",\"documentation_url\":\"https://developer.github.com/v3/repos/contents/#create-or-update-a-file\"}",
      "statusCode":422
   },
   "errorCode":"GITHUB_FILE_ALREADY_EXISTS"
}

Is it possible to oversight? I am starting to think the sha message could be a key, but I am unsure how to proceed.

Thank you for any help.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
alexwaibelcommented, Nov 8, 2019

Question seems to have been answered by @VincentTam. Resolved.

0reactions
VincentTamcommented, Jul 24, 2020

Sorry for super-late reply.

@danieldreke I see your point. I think OP’s problem described in the question context doesn’t require the feature request, which would have been much better to be put in a separate issue because of the one-issue-one-problem principle. Given that we’ve already started the discussion about the FR, I’ll add my comment to the pile.

With respect to the recently established GPDR, I see a motive to ask the collector of static comments, which are a form of data, for a modification. However, let’s think about the target users:

  1. Dev’ers/Prog’ers: they have Git* acct, so they can simply jump into the corresponding auto-gen’d Git* issue and ask the site owner for changing. That would fail if the source code for the static site isn’t public.
  2. Others who don’t write code: examples incl writers, commentators, etc. I doubt if they would bother to take the steps above to have their comments changed.

It seems technically possible, but who practically needs that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

View and update files in Drive - Google Support
Right-click the file and select Manage versions. Click Upload new version and select a file from your computer. When the new version is...
Read more >
files - How is it possible to do a live update while a program is ...
Replacing files in general. First, there are several strategies to replace a file: Open the existing file for writing, truncate it to 0 ......
Read more >
Solved: Is it possible to update a excel file (table) ever...
Solved: Hi, I have been struggling with this problem for awhile and im not sure if it is even possible to update a...
Read more >
modify existing contents of file in c - Stack Overflow
If you switch between input and output on a file opened for update mode, you must use a file positioning operation ( fseek()...
Read more >
To Apply Updates to Files | Inventor 2021
Update incorporates changes to parts or assembly components that are held in memory from the current editing session. The graphics window and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found