Skip to content

Github Action checkout only certain files

License

Notifications You must be signed in to change notification settings

Bhacaz/checkout-files

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

checkout-files

⚠️ Please consider using actions/checkout with the option sparse-checkout.

GitHub Action to checkout only certain files and/or folders. Useful if only need certain files, like config or assets for your workflow, instead of pulling the whole repo.

Usage

Minimal setup.

- name: Checkout files
  uses: Bhacaz/checkout-files@v2
  with:
   files: package.json

Inputs

Name Description Required Default
files A list of files with the path separated by a space, relative to root of your repository. Can also be a folder and the action will recursively pull all the files. true N/A
token A GitHub token. false ${{ github.token }}
branch Checkout files from a specific branch. If not specified, it use the default repository branch.
To use the current working branch ${{ github.head_ref || github.ref_name }}
false Default branch of the repository.

Limitations

  • This action doesn't keep the mode bits (or permission) of files. See #18 for more details.
  • Cannot pull files bigger than 1 mb. WIP #3 & #9