Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andrewthetechie/gha-clone-releases

Github Action to clone releases from one repo to another
https://github.com/andrewthetechie/gha-clone-releases

Last synced: about 1 month ago
JSON representation

Github Action to clone releases from one repo to another

Awesome Lists containing this project

README

        

# gha-clone-releases

[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)

[![Action Template](https://img.shields.io/badge/Action%20Template-Python%20Container%20Action-blue.svg?colorA=24292e&colorB=0366d6&style=flat&longCache=true&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=)](https://github.com/andrewthetechie/gha-clone-releases)
[![Actions Status](https://github.com/andrewthetechie/gha-clone-releases/workflows/Lint/badge.svg)](https://github.com/andrewthetechie/gha-clone-releases/actions)
[![Actions Status](https://github.com/andrewthetechie/gha-clone-releases/workflows/Integration%20Test/badge.svg)](https://github.com/andrewthetechie/gha-clone-releases/actions)

## Description

Clone the releases in one repo to this one

This github action can clone releases from a source repo to your repo. This is useful if you are using a repo to build container
images for an upstream container. You can run this action on a cron schedule to pick up new releases and build new containers.

## Usage

On each run, it will find all releases in `src_repo` and the `dest_repo`, find any releases that exist in `src_repo` and not in your `dest_repo`, and then will create those releases in `dest_repo`.

If you don't define a `dest_repo`, it will use the repo the action is running on as a destination.

### Private Repos

To use this repo with a private repo, you must use a Personal Access Token with access to both the `src_repo` and `dest_repo` as your `token`.

### Github Enterprise

This action supports setting the Github API URL for both the `src_repo` and `dest_repo` separately, allowing you to clone releases between GHE and Github, or to use this action with GHE based repos.

### Example workflow

Here is an example usage of this workflow. If you set this up, every time it runs it would create releases in your repo that mirror the releases in andrewthetechie/testrepo.

```yaml
name: Clone
on:
# kick off the job on demand
workflow_dispatch:
# and run on a schedule every 12 hours
schedule:
- cron: "* */12 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Run action
uses: andrewthetechie/gha-clone-releases@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
src_repo: andrewthetechie/test-repo
```

## Inputs

| parameter | description | required | default |
| - | - | - | - |
| token | Github token | `true` | |
| dest_token | Github token used for destination repo. If not set, token parameter is used | `false` | |
| src_repo | Source repo to clone from | `true` | |
| src_repo_github_api_url | API repo for the src_repo. Defaults to Github. Set this if using GHE | `false` | https://api.github.com |
| dest_repo | Destination repo to clone to, default is this repo | `false` | |
| dest_repo_github_api_url | API repo for the dest_repo. Defaults to Github. Set this if using GHE | `false` | https://api.github.com |
| target | Target for new tags/releases in this repo. If not set, will use the default branch | `false` | |
| skip_draft | Skip draft releases | `false` | false |
| skip_prerelease | Skip Prereleases | `false` | false |
| copy_assets | If true, copy assets from source repo releases to the newly created releases | `false` | false |
| limit | A limit of how many releases to add on a single run. Good for not overwhelming CI systems | `false` | 0 |
| dry_run | If true, just output what releases would have been made but do not make releases | `false` | false |
| min_version | If set, we will ignore any releases from the source repo that are less than min_version | `false` | |

## Outputs

| parameter | description |
| - | - |
| addedReleases | Comma separated list of all the releases created |
| addedReleasesCount | Count of releases added |
| skippedReleasesCount | Count of releases skipped |

## Runs

This action is a `docker` action.

## Contributors



Andrew
Andrew

💻 📖 🤔 ⚠️
jrbe228
jrbe228

🐛 🤔
sebastienrospars
sebastienrospars

💻