Giter Club home page Giter Club logo

force-push-branch-action's Introduction

Warning No longer maintained Use JamesIves/github-pages-deploy-action or peaceiris/actions-gh-pages instead.

Force push branch action

This GitHub action simplifies the process of force pushing an orphan branch to your GitHub repository. You might want to use this to, for example, track an up-to-date set of files generated by your action, but making them more easily accessible than if you used artifacts. For example, I generally use this for providing access to compiled PDFs for scientific papers that I'm working on.

A warning

As it says on the box, this action will force push to your repository, overwriting the history of the target branch. This is always dangerous and you should only use this at your own risk!

Inputs

github-token

Required A token for access to GitHub. The best thing to use here is ${{secrets.GITHUB_TOKEN}} because this action doesn't need any other access and then you won't risk start a terrible never ending loop. You can use a personal access token if you must (but don't).

path

Required A file, directory or wildcard pattern that describes what to upload.

target-branch

Be careful with this parameter. The entire history of this branch will be overwritten! The name of the branch that you want to push to. Either this or branch-suffix must be provided.

branch-suffix

A suffix to add to the current branch name if target-branch is not provided. Either this or target-branch must be provided.

commit-message

The text for a custom commit message. Default: "Automatic commit on GitHub Actions"

Example usage

The following is a basic example of how you can use this action in your workflow:

on: [push]
jobs:
  tests:
    runs-on: ubuntu-latest
    name: Tests
    steps:
      - uses: actions/checkout@v2
      - uses: dfm/force-push-branch-action@v1
        with:
          branch-suffix: "-auto"
          commit-message: "Committing automatically from GitHub Actions"
          path: |
            path/to/a/generated/file
            directories/work/too
            as/to/wildcards/*

force-push-branch-action's People

Contributors

dfm avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rodluger bgriffen

force-push-branch-action's Issues

Suggestion: Add the option to preserve history

I've just started using this Action on a project that requires stylesheet compilation from Sass to CSS for deployment to GitHub Pages, and have found it pretty much perfect for my needs, so thank you very much! However, to me it feels more natural to have commit history structured like this when the source and the 'compiled' code share much of their content (as they do in my case):

   v source commit / branch
-o-o
    \-o
      ^ force-pushed branch

instead of:

   v source commit / branch
-o-o
     o
     ^ force-pushed branch

Is it possible to add the option to create the former structure instead of the latter? If not, that's no problem - I may also just not be aware of a very good reason for you implementing it the way you have!

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.