Skip to content

Commit

Permalink
Change option for downloading all assets to fileName with "*" (#291)
Browse files Browse the repository at this point in the history
* Change option for downloading all assets to fileName with "*"
Add test on CI to download filew from private repo

* Update CI workflow
  • Loading branch information
robinraju authored Aug 29, 2021
1 parent 1ffde54 commit 9518103
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 48 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,21 @@ jobs:
repository: "eloots/course-management-tools"
tag: "1.0.0"
fileName: "course-management-tools.zip"
out-file-path: "."

- run: |
unzip course-management-tools.zip
out-file-path: "./cmt"

- name: List working directory
run: ls -lrth
- name: List downloaded files
run: ls -lrth cmt

- name: Test download from a private repo
uses: ./
with:
repository: "robinraju/release-downloader-test"
latest: true
fileName: "*"
tarBall: true
zipBall: true
token: ${{ secrets.RELEASE_DOWNLOADER_TEST_TOKEN }}
out-file-path: "./downloader-test"

- name: List downloaded files from private repo
run: ls -lrth downloader-test
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ A Github Action to download assets from github release. It can download specifie

# The name of the file to download.
# Use this field only to specify filenames other than tarball or zipball, if any.
# Use '*' to download all assets
fileName: ""

# Download the attached tarball (*.tar.gz)
Expand Down Expand Up @@ -92,3 +93,13 @@ A Github Action to download assets from github release. It can download specifie
tarBall: true
zipBall: true
```

### Download all assets if more than one files are available

```yaml
- uses: robinraju/[email protected]
with:
repository: "user/repo"
latest: true
fileName: "*"
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs:
default: ""
required: false
fileName:
description: "Name of the file to download (if empty it will download all assets)"
description: "Name of the file to download (use '*' to download all assets other than tarball or zipball)"
default: ""
required: false
tarBall:
Expand Down
Loading

0 comments on commit 9518103

Please sign in to comment.