Skip to content
copy

GitHub Action

Clone Github Releases

v1.9.0 Latest version

Clone Github Releases

copy

Clone Github Releases

Clone the releases in one repo to this one

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Clone Github Releases

uses: andrewthetechie/gha-clone-releases@v1.9.0

Learn more about this action in andrewthetechie/gha-clone-releases

Choose a version

gha-clone-releases

All Contributors

Action Template Actions Status Actions Status

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.

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

💻