Git Product home page Git Product logo

action-github-commit's Introduction

getsentry/action-github-commit typescript-action status

Commits any changed files using the GitHub API.

Usage

See the Sentry repo for real world examples.

Note: You may want to use a non-default GitHub token (e.g. not the GH Action token) as it will not trigger follow-up workflow runs!

Inputs

Use the source.

Installation

Add the following to your workflow config

    - name: Commit changes
      uses: getsentry/[email protected]

action-github-commit's People

Contributors

alek-sentry avatar billyvg avatar chadwhitacre avatar dependabot[bot] avatar ianwoodard avatar mattgauntseo-sentry avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

action-github-commit's Issues

Errors when updating many files

We need to look into handling a large number of files as we currently have errors due to wrong commit SHA being used when we update multiple files (missing await somewhere).

We also will hit API limits as well because we are creating a new commit per file. We should look into using bulk commits, maybe using the git data API.

Action failing when committing removed files

Action doesn't seem to handle committing removed files well.

Example: https://github.com/getsentry/security-as-code/actions/runs/6302004945/job/17108284070#logs

Error: Error: ENOENT: no such file or directory, open '/filename'
    at Object.openSync (node:fs:590:3)
    at Object.readFileSync (node:fs:458:35)
    at /home/runner/work/_actions/getsentry/action-github-commit/v1.1.0/dist/index.js:92:50
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/_actions/getsentry/action-github-commit/v1.1.0/dist/index.js:35:58)
Error: ENOENT: no such file or directory, open '/filename'

Replace this action with someone else's

There are actions in the marketplace that solve the same problem, we should use one of those rather than maintaining our own.

https://www.google.com/search?q=action+github+commit

https://github.com/marketplace/actions/add-commit
https://github.com/marketplace/actions/git-auto-commit
https://github.com/marketplace/actions/github-commit-push
https://github.com/marketplace/actions/github-action-for-committing-changes-to-a-repository
https://github.com/marketplace/actions/verified-commit

@asottile further suggests that we could reimplement with pre-commit ci or pre-commit ci lite which handles this in a safe manner without exposing creds to GHA.

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.