Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we give multiple files to copy to different destinations? #33

Open
LakshmiRavali opened this issue Aug 12, 2021 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@LakshmiRavali
Copy link

LakshmiRavali commented Aug 12, 2021

I am using this github action, It is copying one source file to one destination directory, Can we give multiple sources and destinations?
My yml file:

- name: Pushes test file
uses: dmnemec/copy_file_to_another_repo_action@main
env:
  API_TOKEN_GITHUB: ${{ secrets.TOKEN }}
with:
  source_file: 'test/transfer/'
  destination_repo: 'repo name'
  destination_folder: 'src/destination/'
  user_email: 'email'
  user_name: 'name'
  commit_message: 'A custom message for the commit'
@LakshmiRavali LakshmiRavali changed the title Can we copy the files of a directory into destination directory without creating the source directory? Can we give multiple files to copy to different destinations? Aug 12, 2021
@dmnemec
Copy link
Owner

dmnemec commented Oct 18, 2021

In it's current state you could add the action multiple times if you have a lot of files in different places. If all the files are in the same dir, could copy the entire directory. You could also setup an action before it to collect all the files to copy so it only does one copy, but you'd have to sort them out in the destination repo somehow.

The main problem is how to collect all the different file paths. Deciding on a way that doesn't break backwards compatibility needs to be done.

@dmnemec dmnemec added the enhancement New feature or request label Oct 18, 2021
@JoseRodrigues443
Copy link

@LakshmiRavali you can check my example here

https://github.com/JoseRodrigues443/Awesome-CV/blob/master/.github/workflows/main.yml

Basically I use a matrix with key values (location and destination) and with that I can do what you need

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        files: [resume, cv, coverletter]
        include:
          - repo: JoseRodrigues443/JoseRodrigues443
            dir: ''
          - repo: JoseRodrigues443/joserodrigues443.github.io
            dir: static/files

@101story
Copy link

@LakshmiRavali you can check my example here

https://github.com/JoseRodrigues443/Awesome-CV/blob/master/.github/workflows/main.yml

Basically I use a matrix with key values (location and destination) and with that I can do what you need

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        files: [resume, cv, coverletter]
        include:
          - repo: JoseRodrigues443/JoseRodrigues443
            dir: ''
          - repo: JoseRodrigues443/joserodrigues443.github.io
            dir: static/files

I'm trying to use this action in my project. but i also need to push all files in one directory.
I think this is also a good idea. Thanks for sharing.
And I just want to add more conditions a little. like i want to create one PR in another repo for all file or just changed files only.

Is there a possible way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants