Skip to content

Commit

Permalink
Merge pull request #73 from scality/expose_upload_artifacts_outputs
Browse files Browse the repository at this point in the history
Expose scality/action-artifacts outputs to the caller
  • Loading branch information
Alexandre Lavigne authored Jun 7, 2023
2 parents 06ae105 + 40602e5 commit cbf9206
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/docker-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ jobs:
- run: docker pull "ghcr.io/${{ github.repository }}/test:${{ github.sha }}"
- uses: ./upload_final_status
if: always()
id: artifacts
with:
ARTIFACTS_USER: ${{ secrets.ARTIFACTS_USER }}
ARTIFACTS_PASSWORD: ${{ secrets.ARTIFACTS_PASSWORD }}
- name: print outputs
run: |
echo "Link: ${{ steps.artifacts.outputs.link }}"
echo "Name: ${{ steps.artifacts.outputs.name }}"
- name: ensure outputs contains link and name
shell: python
run: |
link_prefix = "https://artifacts.scality.net/builds/github:scality:actions:staging-"
if "${{ steps.artifacts.outputs.link }}".find(link_prefix) < 0:
raise RuntimeError("the ouput link does not contain the expected prefix")
name_prefix = "github:scality:actions:staging-"
if "${{ steps.artifacts.outputs.name }}".find(name_prefix) < 0:
raise RuntimeError("the output name does not contain the expected name")
13 changes: 13 additions & 0 deletions upload_final_status/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ inputs:
description: Concatenation of jobs results
required: true

outputs:
name:
description: |
The name of the artifacts for a specific workflow.
This name will be unique for the whole workflow and can be
used by further steps to locate the artifacts inside a job.
value: ${{ steps.artifacts.outputs.name }}
link:
description: |
The full url in which artifacts will be stored.
value: ${{ steps.artifacts.outputs.link }}

runs:
using: composite
steps:
Expand All @@ -34,6 +46,7 @@ runs:
echo -n "SUCCESSFUL" > ${{ steps.temp-dir.outputs.TEMP }}/.final_status
- name: upload file to artifacts
uses: scality/action-artifacts@v3
id: artifacts
with:
method: upload
url: https://artifacts.scality.net
Expand Down

0 comments on commit cbf9206

Please sign in to comment.