Skip to content
copy

GitHub Action

Mirror files action

v1.0.0 Latest version

Mirror files action

copy

Mirror files action

GitHub action to easily mirror files between repositories

Installation

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

              

- name: Mirror files action

uses: danielbayley/[email protected]

Learn more about this action in danielbayley/mirror-action

Choose a version

Mirror

GitHub Action to easily mirror* files between repositories.

* This action uses rsync over cp to easily preserve folder structure. runs-on: macos-latest.

Usage

Input Required Default Description
git_author_name false github.actor GIT_AUTHOR_NAME environment variable.
git_author_email false github.event.pusher.email GIT_AUTHOR_EMAIL
git_committer_name false inputs.git_author_name GIT_COMMITTER_NAME
git_committer_email false inputs.git_author_email GIT_COMMITTER_DATE
github_token env.GITHUB_TOKEN Required unless env.GITHUB_TOKEN is set. Generate an access token, then add to your repository secrets.
source_files true Specify an [extended] glob pattern of matching files to mirror.
source_repo false github.repository Optionally specify a different repository source to copy files from.
target_repo true Specify the target repository. The owner will match the source repo if only the name is given.
target_path false Optionally specify a different target file path other than the repository root.
source_branch false main Optionally specify a source branch of your repository.
target_branch false main Optionally specify a target branch of the target repo.
branch false main Specify if both branches are the same, but differ from the default.
commit_message false Mirror inputs.source_files from github.repository The git commit -[-m]essage to appear on the target repository.

Example

name: Mirror
on:
  push:
    paths:
    - .github/hooks/*

jobs:
  Mirror:
    runs-on: macos-latest
    steps:
    - name: ${{github.job}} files
      uses: danielbayley/mirror-action@main
      #env:
        #GITHUB_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}}
      with:
        github_token: ${{secrets.PERSONAL_ACCESS_TOKEN}}
        source_files: .github/hooks/*
        target_repo: target/repo

License

MIT © Daniel Bayley