Hugely inspired by work of @marocchino in marocchino/on_artifact.
name: Upload Artifact
on:
pull_request:
permissions:
contents: read
jobs:
upload-artifact:
runs-on: ubuntu-latest
permissions:
# only required for workflows in private repositories
actions: read
steps:
- name: Repository checkout
uses: actions/checkout@v4
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: README as Artifact
path: README.md
name: Download Artifact
on:
workflow_run:
workflows: [ Upload Artifact ]
types:
- completed
permissions:
contents: read
jobs:
download-artifact:
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
# required for all workflows when deleting artifact
actions: write
steps:
- id: Artifact
name: Download Artifact
uses: redhat-plumbers-in-action/download-artifact@v1
with:
name: README as Artifact
- name: Log Artifact data
run: |
echo "::warning::${{ steps.Artifact.outputs.README-md }}"
Action currently accepts the following options:
# ...
- uses: redhat-plumbers-in-action/download-artifact@v1
with:
name: <name of artifact>
path: <relative path>
remove-archive: <boolean>
remove-extracted-files: <boolean>
delete-artifact: <boolean>
run-id: <id>
token: <GITHUB_TOKEN or PAT>
# ...
Name of artifact.
- default value:
undefined
- requirements:
required
Downloaded artifact archive will be extracted to this destination. Default value is artifact name. Make sure that specified path exist.
- default value:
name of artifact
- requirements:
optional
When set to true
, downloaded artifact archive will be removed from VM once it's extracted.
- default value:
true
- requirements:
optional
When set to true
, files extracted form artifact will be removed from VM. They will be still accessible by GitHub Action outputs.
- default value:
false
- requirements:
optional
When set to true
, GitHub Action will delete artifact from GitHub after it has been processed.
- default value:
false
- requirements:
optional
Identification of workflow with artifact that we want to download.
- default value:
${{ github.event.workflow_run.id }}
- requirements:
optional
GitHub token used access GitHub API.
- default value:
${{ github.token }}
- requirements:
optional