GitHub Action
Clone Github Releases
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.
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.
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
.
Currently, this action does not support Github Enterprise. If you would like to see support for Github Enterprise, please vote on this issue.
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
parameter | description | required | default |
---|---|---|---|
token | Github token | true |
|
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 |
parameter | description |
---|---|
addedReleases | Comma separated list of all the releases created |
addedReleasesCount | Count of releases added |
skippedReleasesCount | Count of releases skipped |
This action is a docker
action.
Andrew 💻 📖 🤔 |
jrbe228 🐛 🤔 |