Git Product home page Git Product logo

rebase-upstream-action's Introduction

Rebase Upstream Action

This Action is suitable if you:

  • are maintaining a fork
  • have changes that are not going to be merged into upstream
  • want to keep changes based on the latest upstream

Basically this is doing git rebase upstream master && git push -f. If there are conflicts, it simply fails.

Typical usage

# .github/workflows/sync.yml
name: Rebase Upstream
on:
  schedule:
  - cron: "0 0 * * 0"  # run once a week
  workflow_dispatch:   # run manually

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
      with:
        fetch-depth: 10  # greater than the number of commits you made
    - uses: imba-tjd/rebase-upstream-action@master
      # with:  # all args are optional
      #   upstream: <user>/<repo>
      #   branch:   master

Comparison

  • tgymnich/fork-sync and apps/pull: I don't want PRs. Besides there is not way to do a git rebase on GitHub website
  • repo-sync/github-sync: It's not using rebase or merge. It completely mirrors the upstream so that it can't sync current branch
  • wei/git-sync: Very complicated and have the same issue as github-sync. After all its aim is "syncing between two independent repo"
  • aormsby/Fork-Sync-With-Upstream-action: If set git_pull_rebase_config: true, it's similar. But it tries to be configurable so that looks complex
  • This one: Not widely tested. Use with caution

rebase-upstream-action's People

Contributors

imba-tjd avatar thetoddluci0 avatar

Stargazers

 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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rebase-upstream-action's Issues

github_token argument is not optional

When running this action as documented in the Readme, I get the following output:

Run imba-tjd/rebase-upstream-action@master
  with:
    branch: master
    depth: 100
+ UPSTREAM=
? How would you like to authenticate GitHub CLI?  [Use arrows to move, type to filter]
+ '[' -z ']'
> Login with a web browser
+ echo
  Paste an authentication token
+ gh auth login --with-token
25l25h
could not prompt: EOF

The github_token input to the action is not only undeclared, but also required to run the action, is that correct? Do you have any real-world examples where this action is used?

Check if the rebase would add any workflows and/or actions and fail

I was thinking about the security of github workflows if you automatically merge any changes from a remote repository into yours. Maybe a workflow input would be helpfull to enable a functionality that checks if any files in .github/workflowsor .github/actions are going to be changed and if so fail the workflow. If the user of this action actually wants to have these changes as well it would be best to do that manually or only on workflow_dispatch (or disable the check).

If you think this is a good idea I'll be happy to provide a PR.

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.