Code Monkey home page Code Monkey logo

publish-to-github-action's Introduction

publish-to-github-action

A GitHub Action to push any local file changes, including new files, back to supplied branch name.

This action is useful to put after other actions that modify files in the local checkout that you'd then like to persist back into the repository.

Usage:

- uses: mikeal/publish-to-github-action@master
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    BRANCH_NAME: '' #optional defaults to master

If you can get away with only ever writing new files, instead of updating them, you won’t regret it ;) Every time you update a file you retain the history of the file. Over time this can become quite large and contain a lot of duplicate data, even when using Git LFS as described below. The only way to garbage collect this historical data is to use a hefty Java program called BFG to re-write the history.

Large Files (Git LFS)

For large data files, or if you have a lot of data, this action comes with the dependencies required for Git LFS, so as long as you've initialized and configured LFS for the files you're adding they will be added and pushed via Git LFS. This is particularly helpful if you are running into GitHub's 1GB data limit.

One thing to note is that files in Git LFS are stored out of the repository and then pulled in by LFS specific tools. This means that the default git checkout in an action won't have the real file data, it will have file stubs that tell LFS how to download the files. If your action needs these files to be fully available you have two options.

  1. Set the lfs option to true in your checkout action. This will download all the LFS files, which is rarely ideal and is a great way to blow out your LFS transfer limit ;)
  2. Prior to reading the files, run git lfs install and git pull --include files-i-want/* in your action. This will pull out only the selected files.

publish-to-github-action's People

Contributors

mikeal avatar isaacrlevin avatar fregante avatar swyxio avatar

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.