Skip to content

Test Download Artifacts Action #119

Test Download Artifacts Action

Test Download Artifacts Action #119

---
name: Test Download Artifacts Action
on:
workflow_dispatch:
inputs: {}
workflow_run:
workflows:
- Upload Test Artifacts
types:
- completed
jobs:
download-latest:
name: Download Latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Download
uses: ./download-artifacts
with:
workflow: upload-test-artifacts.yml
artifacts: artifact
path: artifact
- name: Test
run: |
cat artifact/sha
echo $GITHUB_SHA
download-master:
name: Download master
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Download
uses: ./download-artifacts
with:
workflow: upload-test-artifacts.yml
artifacts: artifact
path: artifact
branch: master
- name: Test
run: |
cat artifact/sha
echo $GITHUB_SHA
download-branch:
name: Download current branch
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Extract branch name
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Download
uses: ./download-artifacts
with:
workflow: upload-test-artifacts.yml
artifacts: artifact
path: artifact
branch: ${{ steps.extract_branch.outputs.branch }}
- name: Test
run: |
cat artifact/sha
echo $GITHUB_SHA
download-pr:
name: Download Pull Request
runs-on: ubuntu-20.04
if: github.ref != 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Download
uses: ./download-artifacts
with:
workflow: upload-test-artifacts.yml
artifacts: artifact
path: artifact
pr: ${{github.event.pull_request.number}}
- name: Test
run: |
cat artifact/sha
echo $GITHUB_SHA
download-all:
name: Download All
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Download
uses: ./download-artifacts
with:
workflow: upload-test-artifacts.yml
- name: Test
run: |
ls -atlh
cat sha
cat sha1
cat sha2
download-multiple:
name: Download Multiple
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Download
uses: ./download-artifacts
with:
workflow: upload-test-artifacts.yml
artifacts: 'artifact1,
artifact2'
- name: Test
run: |
ls -atlh
cat sha1
cat sha2
download-wildcard:
name: Download Wildcard
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Download
uses: ./download-artifacts
with:
workflow: upload-test-artifacts.yml
artifacts: '*.txt'
- name: Test
run: |
ls -atlh
cat sha1
cat sha2
download-conclusion:
name: Download Conclusion
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Download
uses: ./download-artifacts
with:
workflow: upload-test-artifacts.yml
artifacts: artifact
path: artifact
workflow_conclusion: ''
- name: Test
run: |
cat artifact/sha
echo $GITHUB_SHA