Giter VIP home page Giter VIP logo

Comments (7)

jaywcjlove avatar jaywcjlove commented on September 22, 2024

I added ref input parameter.
@Emily-Thomas

from github-action-modify-file-content.

Emily-Thomas avatar Emily-Thomas commented on September 22, 2024

Thank you so much, I will test this out and let you know.

from github-action-modify-file-content.

Emily-Thomas avatar Emily-Thomas commented on September 22, 2024

@jaywcjlove I am trying to use this but am getting the error [PATH] does not match [sha] after modifyPathContents Body: runs

Potentially related to this? octokit/octokit.rb#581 I think it is a github error bubbling up when trying to make the commit and the SHA is not accurate.

from github-action-modify-file-content.

Emily-Thomas avatar Emily-Thomas commented on September 22, 2024

Here is a copy of my setup.

    - name: New Branch
      uses: peterjgrainger/[email protected]
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        branch: 'var-${{ steps.date.outputs.date }}'
        sha: '${{ github.event.pull_request.head.sha }}'
    - uses: actions/checkout@v3
      with:
        ref: 'var-${{ steps.date.outputs.date }}'
    - name: Modify Conf
      uses: jaywcjlove/github-action-modify-file-content@main
      with:
        path: file.conf
        body: ${{ steps.getdata.outputs.data }}
        ref: 'var-${{ steps.date.outputs.date }}'

from github-action-modify-file-content.

jaywcjlove avatar jaywcjlove commented on September 22, 2024

@Emily-Thomas

specify branch changes

- name: Modify test test/overwrite.file.md
  uses: github-action-modify-file-content@main
  with:
    branch: test
    path: test/overwrite.file.md
    body: "{{date:YYYY-MM-DD HH:mm:ss}}"
    overwrite: 'true'

- name: Modify test test/overwrite.file.md
# uses: github-action-modify-file-content@main
uses: ./
with:
branch: test
path: test/overwrite.file.md
body: "{{date:YYYY-MM-DD HH:mm:ss}}"
overwrite: 'true'

from github-action-modify-file-content.

Emily-Thomas avatar Emily-Thomas commented on September 22, 2024

Okay, I updated to use that format. Now the logging is correct in the action workflow, but the commit that is made is an empty commit. I've tried a few combinations of using path + ref, only path, only ref, using overwrite/not using overwrite and the result is the same, an empty commit. However when I go through the logging of the function, it is grabbing the right tag in the file and replacing it - just not saving or commiting those changes. @jaywcjlove - I appreciate the timely help and changes here.

from github-action-modify-file-content.

Emily-Thomas avatar Emily-Thomas commented on September 22, 2024

Your latest changes work for me. Thanks for being so responsive to my issues. I was able to implement this action into my codebase successfully.

from github-action-modify-file-content.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.