Skip to content

Test Download Artifacts Action #187

Test Download Artifacts Action

Test Download Artifacts Action #187

---
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-22.04
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- 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-22.04
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- 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-22.04
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Extract branch name
id: extract_branch
run: |
branch=${GITHUB_REF#refs/heads/}
echo "branch=$branch" >> $GITHUB_OUTPUT
- 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-22.04
if: github.ref != 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- 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-22.04
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- 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-22.04
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- 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-22.04
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- 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-22.04
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- 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