GithubHelp home page GithubHelp logo

tibtiq / copy_file_to_another_repo_action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dmnemec/copy_file_to_another_repo_action

0.0 0.0 1.0 115 KB

This GitHub Action copies a file from the current repository to a location in another repository. Files are pushed with --force.

License: Apache License 2.0

Shell 93.38% Dockerfile 6.62%

copy_file_to_another_repo_action's Introduction

Changes from original action

This github action differs from the original action in the last step. When pushing the commit it is done with --force. This was to fix an error I was having when running the action when the destination branch existed and had changes.

The error I encountered

error: failed to push some refs to REPO
hint: Updates were rejected because the remote contains work that you do not
hint: have locally. This is usually caused by another repository pushing to
hint: the same ref. If you want to integrate the remote changes, use
hint: 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

copy_file_to_another_repo_action

This GitHub Action copies a file from the current repository to a location in another repository

Example Workflow

name: Push File

on: push

jobs:
  copy-file:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: Pushes test file
      uses: dmnemec/copy_file_to_another_repo_action@main
      env:
        API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
      with:
        source_file: |
          'test2.md'
          'test1.md'
          '/copy_folder'
          '/copy_files_in_folder/'
        destination_repo: 'dmnemec/release-test'
        user_email: '[email protected]'
        user_name: 'dmnemec'
        commit_message: 'A custom message for the commit'

Variables

This section is probably out of date, its best to reference the action.yml file directly.

The API_TOKEN_GITHUB needs to be set in the Secrets section of your repository options. You can retrieve the API_TOKEN_GITHUB here (set the repo permissions).

  • source_files: The file or directory to be moved. Uses the same syntax as the rsync command. Incude the path for any files not in the repositories root directory. Possible to specify multiple sources by separating them by spaces.
  • destination_repo: The repository to place the file or directory in.
  • user_email: The GitHub user email associated with the API token secret.
  • user_name: The GitHub username associated with the API token secret.
  • destination_branch: [optional] The branch of the source repo to update, if not "main" branch is used.
  • destination_branch_create: [optional] A branch to be created with this commit, defaults to commiting in destination_branch
  • commit_title: [optional] A custom commit title for the commit. Defaults to Update from ${GITHUB_REPOSITORY}
  • commit_description: [optional] A custom commit description for the commit. Defaults to Update from https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}
  • use_rsync: [optional] Uses rsync -avh instead of cp -R to perform the base operation. Currently works as an experimental feature (due to lack of testing) but can speed up updates to large collections of files with many small changes by only syncing the changes and not copying the entire contents again. Please understand your use case before using this, and provide feedback as issues if needed.

Behavior Notes

The action will create any destination paths if they don't exist. It will also overwrite existing files if they already exist in the locations being copied to. It will not delete the entire destination repository.

copy_file_to_another_repo_action's People

Contributors

dmnemec avatar tibtiq avatar sta-szek avatar bboles avatar lukasklein avatar drakos74 avatar filipepiresg avatar maliksteam avatar splitice avatar mindaugaslaganeckas avatar seemiller avatar walterddr avatar aefraimidis avatar exponentactivity avatar haojianzong avatar

copy_file_to_another_repo_action's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.