Giter Club home page Giter Club logo

pull-detached-remote's Introduction

pull-detached-remote

GitHub Marketplace

Warning: Deprecated
This action is deprecated and can easily be replaced by a simpler alternative workflow

Creates a branch with updates from a detached (not actively set) upstream of a repo and a corresponding PullRequest

If you don't understand the quick summary read the following:

Why?

This action was mainly created for the following use-case:

You have a GitHub repo that is not directly linked via an upstream-remote This can be achieved by

Now you wan't to update this repo from it's "upstream" (which is not actively set / detached).
You can do that manually, but after some time (especially when there are more often commits on the "upstream"), you definetly wan't to do that automated.

An here this action comes into spotlight.

It automatically updates your "detached upstream":
Firstly it checks if there are new commits on the upstream.
When there are new ones, it creates a new branch and a pull request.

The action is based on PullDetachedRemote

Usage

A simple worfklow example:

name: Pull detached upstream automatically from https://github.com/<owner>/<repo>

on:
  # Possibility to run it manually
  workflow_dispatch:
  # Automated
  schedule:
    # Run this every day at 02:22 UTC
    - cron: '22 2 * * *'
  
  
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      # Checkout the current repo
      - uses: actions/checkout@v2
      # Fetch the history and unshallow the repo so that it can be used
      - name: Fetch all history for all tags and branches
        run: git fetch --prune --unshallow
      # Pull the detached remote and do the magic
      - name: Pull Detached Remote
        uses: litetex/pull-detached-remote@<VERSIONTAG>
        with:
          upstreamrepo: https://github.com/<owner>/<repo>
          upstreambranch: <branchname>
        env:
          GITHUB_PAT: ${{ secrets.GH_PAT }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Inputs

โ†’ see also Configuration.cs

Parameters

โ†’ see action.yml

Environment-Variables

Variable State Description Notes
GITHUB_PAT Required A personal access token, that is used for git modifications of the targeted repo This is the fallback if no GITHUB_TOKEN is set

Add it to the secrets

GitHub Documentation
GITHUB_TOKEN Recommended A token automatically created by GitHub for workflows on the current repo If not set, the owner of the GITHUB_PAT will be the author of the pull request

GitHub Documentation
DETACHED_CREDS_PRINCIPAL Optional Principal/Username (if you have a token, use it here and leave password blank) Only required if a repository outside of GitHub has to be authenticated

Only used if:
  • upstreamcredmode=AUTO (default)
    the upstream-repo is not hosted on GitHub and DETACHED_CREDS_PRINCIPAL is set
  • upstreamcredmode=CUSTOM
DETACHED_CREDS_PW Optional Password
NO_PR_STATUS Optional Disables the status message in the pull request Valid values: 1 or true
NO_CREDITS Optional Disables the credits in the pull request Valid values: 1 or true

Demos

Here you can find a demo implementations:

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.