https://github.com/litetex/pull-detached-remote
Creates a branch with updates from a detached upstream of a repo and a corresponding PullRequest
https://github.com/litetex/pull-detached-remote
auto-pull-request automated-updates detached forks pull upstream
Last synced: 11 months ago
JSON representation
Creates a branch with updates from a detached upstream of a repo and a corresponding PullRequest
- Host: GitHub
- URL: https://github.com/litetex/pull-detached-remote
- Owner: litetex
- License: mit
- Created: 2020-05-13T17:11:54.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2023-03-10T21:31:19.000Z (almost 3 years ago)
- Last Synced: 2024-09-17T19:26:19.720Z (over 1 year ago)
- Topics: auto-pull-request, automated-updates, detached, forks, pull, upstream
- Language: Dockerfile
- Homepage:
- Size: 96.7 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
pull-detached-remote
[](https://github.com/marketplace/actions/pull-detached-remote)
> **Warning**: **Deprecated**
This action is deprecated and can easily be replaced by a [simpler alternative workflow](./alternative.yml)
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](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork)
This can be achieved by
* [duplicating](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/duplicating-a-repository) a repo or
* [forking](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-forks) a repo and [removing it's upstream remote](https://stackoverflow.com/questions/29326767/unfork-a-github-fork-without-deleting/41486339)
Now you wan't to update this repo from it's "upstream" (which is not actively set / detached).
You [can do that manually](https://gist.github.com/CristinaSolana/1885435), 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](https://github.com/litetex/PullDetachedRemote)
## Usage
A simple worfklow example:
```YAML
name: Pull detached upstream automatically from https://github.com//
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@
with:
upstreamrepo: https://github.com//
upstreambranch:
env:
GITHUB_PAT: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
## Inputs
→ see also [Configuration.cs](https://github.com/litetex/PullDetachedRemote/blob/develop/PullDetachedRemote/Config/Configuration.cs)
### Parameters
→ see [action.yml](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:
* [avesflower](https://github.com/BaseMC/avesflower/blob/develop/.github/workflows/upstream_update.yml)