Skip to content

Commit

Permalink
Add new redirect link output (#493)
Browse files Browse the repository at this point in the history
Option to use the redirect-link which redirects the client to a
pre-signed S3 url for data to be provided directly by the bucket.
  • Loading branch information
tcarmet authored Jun 28, 2024
1 parent b6aec04 commit 914687f
Show file tree
Hide file tree
Showing 7 changed files with 40,868 additions and 39,057 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,19 @@ jobs:
run: cmp --silent upload_README.md ./README.md
- name: Download file with artifacts-link
run: curl -u ${{ secrets.ARTIFACTS_USER }}:${{ secrets.ARTIFACTS_PASSWORD }} --silent --fail --show-error --max-time 3600 ${{ steps.artifacts-upload.outputs.link }}/action.yaml > upload_action.yaml
- name: Download file with redirect-link
run: curl -u ${{ secrets.ARTIFACTS_USER }}:${{ secrets.ARTIFACTS_PASSWORD }} -L --silent --fail --show-error --max-time 3600 ${{ steps.artifacts-upload.outputs.redirect-link }}/action.yaml > redirect-link.yaml
- name: Download with artifacts-url and artifacts-name
run: curl -u ${{ secrets.ARTIFACTS_USER }}:${{ secrets.ARTIFACTS_PASSWORD }} --silent --fail --show-error --max-time 3600 ${{ vars.ARTIFACTS_URL }}/builds/${{ steps.artifacts-upload.outputs.name }}/action.yaml > name_action.yaml
- run: NUMBER_OF_FILES=$(curl -u ${{ secrets.ARTIFACTS_USER }}:${{ secrets.ARTIFACTS_PASSWORD }} --silent --fail --show-error --max-time 3600 ${{ vars.ARTIFACTS_URL }}/download/${{ steps.artifacts-upload.outputs.name }}/?format=text)
- name: Verify number of files
run: $([[ $NUMBER_OF_FILES -le 103 ]])
- name: Compare files
run: cmp --silent upload_action.yaml ./name_action.yaml
- name: Compate files2
- name: Compare files2
run: cmp --silent upload_action.yaml ./action.yaml
- name: Compare redirect link downloaded file
run: cmp --silent redirect-link.yaml action.yaml

test-empty-folder:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ This action will output the following variables:

* `name`: Will contain a generated name for the artifacts that will be used for a workflow. Each workflow will have a unique artifact name which can be shared among the jobs that are within.
* `link`: The full url in which artifacts will be stored.
* `redirect-link`: The full url that will redirect clients to a pre-signed S3 url
providing data through the S3 bucket instead of the Artifacts service.

## Scenarios

Expand Down
5 changes: 5 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ outputs:
description: |
The full url in which artifacts will be stored.
value: ${{ steps.artifacts.outputs.link }}
redirect-link:
description: |
The full url that will redirect clients to a pre-signed S3 url providing data
through the S3 bucket instead of the Artifacts service.
value: ${{ steps.artifacts.outputs.redirect-link }}
runs:
using: 'node20'
main: 'dist/index.js'
Expand Down
Loading

0 comments on commit 914687f

Please sign in to comment.