/GitHub-Downloader-Action

A Github Action to download single files or folders from another repo without cloning.

Primary LanguageShellMIT LicenseMIT

GitHub-Downloader-Action

A Github Action to download single files or folders from another repo without cloning.
Show your support!

Example and usage

How to use this action

How to download files & folders

To download a single file:

 - uses: MarketingPipeline/GitHub-Downloader-Action@main
   with:
     repo: https://github.com/Repo-Owner-UserName/Repo-Name/blob/master/README.md

To download a specific folder:

 - uses: MarketingPipeline/GitHub-Downloader-Action@main
   with:
     repo: https://github.com/Repo-Owner-UserName/Repo-Name/blob/master/Folder-Name

To download all files in a repo folder:

  - uses: MarketingPipeline/GitHub-Downloader-Action@main
   with:
     repo: https://github.com/Repo-Owner-UserName/Repo-Name/blob/master/

Workflow Example(s) / Usage



View Example Workflow Usage

- uses: actions/checkout@v2
- uses: MarketingPipeline/GitHub-Downloader-Action@main
  with:
    repo: https://github.com/MarketingPipeline/GitHub-Downloader-Action/blob/master/README.md


- name: Commit and Push Downloaded Files
  run: |
     git config --global user.name "github-actions[bot]"
     git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
     git add -A
     git commit -m "Updated Static Content"
     git push

Example workflow file


Workflow Options:

How to change download path

WARNING: Desintation folder / download path must exist in your repo or you will face issues

By default files will be placed into the root of your repo. To change this you need to include this option in your workflow.

Example:

  with:
    repo: https://github.com/MarketingPipeline/GitHub-Downloader-Action/blob/master/README.md
filepath: .github/



How to over-write filenames

By default files will not be over-written. To change this you need to include this option in your workflow.

Example:

  with:
     repo: https://github.com/MarketingPipeline/GitHub-Downloader-Action/blob/master/README.md
 filepath: .github/
 overwrite: true





Contributing GitHub

Want to imrpove this action? Create a pull request with described in detail with your changes! If approved you will be added to the list of contributors of this awesome project!

See also the list of contributors who participate in this project.

License GitHub

This project is licensed under the MIT License - see the LICENSE.md file for details.