file-sync

command module
v1.0.28-ea40eb6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2022 License: CC0-1.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

file-sync

A GitHub Action which synchronizes files from another repository

.github/workflows/gotest.yml .github/workflows/golint.yml .github/workflows/release.yml .github/workflows/sonar.yml

SonarCloud

Quality Gate Status Vulnerabilities Reliability Rating

Features

  • Keep files across multiple repositories up to date automatically
  • Opens a pull request for file sync updates
  • Easily configurable

Example Usage

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

      - uses: champ-oss/file-sync
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          repo: champ-oss/terraform-module-template
          files: |
            .gitignore
            Makefile
            templates/LICENSE-template=LICENSE
            myworkflow.yml=.github/workflows/build.yml

Token

By default the GITHUB_TOKEN should be passed to the actions/checkout step as well as this action (see example usage). This is necessary for the action to be allowed to push changes to a branch as well as open a pull request.

Important:

If you are syncing workflow files (.github/workflows) then you will need to generate and use a Personal Access Token (PAT) with repo and workflow permissions.

File list

One file should be specified per-line. You can specify the file in the format <source_path>=<destination_path. The paths are relative to the root of the source and destination repositories. For example:

  files: |
    templates/mystuff/.gitignore.tmpl=.gitignore
    myworkflow.yml=.github/workflows/build.yml

Or, if only a filename is specified then file will be copied from the source to the destination in the same directory path and name. For example:

  files: |
    .gitignore

Parameters

Parameter Required Description
token false GitHub Token or PAT
repo true Source GitHub repo
files true List of files to sync
target-branch false Target branch for pull request
pull-request-branch false Branch to push changes
user false Git username
email false Git email
commit-message false Updated by file-sync

Contributing

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL