file-sync

command module
v1.0.67-f20efd0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: CC0-1.0 Imports: 5 Imported by: 0

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
  • Optionally deletes files

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
         delete-files: |
          .github/workflows/old-workflow.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
delete-files false List of files to delete

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