Browse Source

updating the test workflow and the README

feature/add-renaming-download-action
Joseph Flinn 4 years ago
parent
commit
1b96f47cc0
  1. 16
      .github/workflows/test-download-artifacts.yml
  2. 23
      download-artifacts/README.md

16
.github/workflows/test-download-artifacts.yml

@ -16,7 +16,7 @@ jobs: @@ -16,7 +16,7 @@ jobs:
- name: Download
uses: ./download-artifacts
with:
workflow: upload.yml
workflow: upload-test-artifacts.yml
artifacts: artifact
path: artifact
@ -35,7 +35,7 @@ jobs: @@ -35,7 +35,7 @@ jobs:
- name: Download
uses: ./download-artifacts
with:
workflow: upload.yml
workflow: upload-test-artifacts.yml
artifacts: artifact
path: artifact
branch: master
@ -55,7 +55,7 @@ jobs: @@ -55,7 +55,7 @@ jobs:
- name: Download
uses: ./download-artifacts
with:
workflow: upload.yml
workflow: upload-test-artifacts.yml
artifacts: artifact
path: artifact
pr: ${{github.event.pull_request.number}}
@ -74,7 +74,7 @@ jobs: @@ -74,7 +74,7 @@ jobs:
- name: Download
uses: ./download-artifacts
with:
workflow: upload.yml
workflow: upload-test-artifacts.yml
- name: Test
run: |
@ -92,7 +92,7 @@ jobs: @@ -92,7 +92,7 @@ jobs:
- name: Download
uses: ./download-artifacts
with:
workflow: upload.yml
workflow: upload-test-artifacts.yml
artifacts: 'artifact1,
artifact2'
@ -113,7 +113,7 @@ jobs: @@ -113,7 +113,7 @@ jobs:
- name: Download
uses: ./download-artifacts
with:
workflow: upload.yml
workflow: upload-test-artifacts.yml
artifacts: '*.txt'
- name: Test
@ -132,7 +132,7 @@ jobs: @@ -132,7 +132,7 @@ jobs:
- name: Download
uses: ./download-artifacts
with:
workflow: upload.yml
workflow: upload-test-artifacts.yml
artifacts: 'artifact1|renamed_artifact1,
artifact2|renamed_artifact2'
@ -153,7 +153,7 @@ jobs: @@ -153,7 +153,7 @@ jobs:
- name: Download
uses: ./download-artifacts
with:
workflow: upload.yml
workflow: upload-test-artifacts.yml
artifacts: artifact
path: artifact
workflow_conclusion: ''

23
download-artifacts/README.md

@ -6,13 +6,30 @@ manner. @@ -6,13 +6,30 @@ manner.
An action that downloads and extracts uploaded artifact associated with given workflow and commit or other criteria.
Let's suppose you have a workflow with a job in it that at the end uploads an artifact using `actions/upload-artifact` action and you want to download this artifact in another workflow that is run after the first one. Official `actions/download-artifact` does not allow this. That's why I decided to create this action. By knowing only the workflow name and commit SHA, you can download the previously uploaded artifact from different workflow associated with that commit and use it.
Let's suppose you have a workflow with a job in it that at the end uploads an artifact using `actions/upload-artifact`
action and you want to download this artifact in another workflow that is run after the first one. Official
`actions/download-artifact` does not allow this. That's why I decided to create this action. By knowing only the
workflow name and commit SHA, you can download the previously uploaded artifact from different workflow associated
with that commit and use it.
## Development
We are using `ncc` to compile the dependencies and package the action. The compile script will be found at
`dist/index.js` and that is the file that `action.yml` is configured to use.
1. `npm install`
2. `npx ncc build index.js --license licenses.txt`
## Testing
We are utilizing `jest` as a unit testing framework for to inspire TDD. This can be run in your development workflow
(non-automated) by running `npm test`.
## Usage
> If `commit` or `pr` or `branch` or `run_id` or `workflow_conclusion` is not specified then the artifact from the most recent successfully completed workflow run will be downloaded.
> If `commit` or `pr` or `branch` or `run_id` or `workflow_conclusion` is not specified then the artifact from the
> most recent successfully completed workflow run will be downloaded.
**Do not specify `pr`, `commit`, `branch`, `run_id` together or `workflow_conclusion` and `run_id` together. Pick just one of each or none.**
**Do not specify `pr`, `commit`, `branch`, `run_id` together or `workflow_conclusion` and `run_id` together. Pick just
one of each or none.**
```yaml
- name: Download artifact

Loading…
Cancel
Save