Skip to content

Commit f21583e

Browse files
authored
add url output, add test, add readme example (#11)
1 parent a3c3643 commit f21583e

File tree

5 files changed

+8583
-8560
lines changed

5 files changed

+8583
-8560
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ jobs:
33
circleci_artifacts_redirector_job:
44
runs-on: ubuntu-latest
55
name: Run CircleCI artifacts redirector
6+
outputs:
7+
url: ${{ steps.run-circleci-artifacts-redirector.outputs.url }}
68
steps:
79
# WARNING!
810
# This repo uses the action in its own root directory.
@@ -16,3 +18,14 @@ jobs:
1618
repo-token: ${{ secrets.GITHUB_TOKEN }}
1719
artifact-path: 0/test_artifacts/root_artifact.md
1820
id: run-circleci-artifacts-redirector
21+
22+
use_outputs_job:
23+
runs-on: ubuntu-latest
24+
needs: [circleci_artifacts_redirector_job]
25+
name: Use the output
26+
steps:
27+
- name: Checkout repo
28+
uses: actions/checkout@master
29+
- name: Check the URL
30+
run: |
31+
curl --fail ${{ needs.circleci_artifacts_redirector_job.outputs.url }} | grep $GITHUB_SHA

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@ jobs:
1414
name: Run CircleCI artifacts redirector
1515
steps:
1616
- name: GitHub Action step
17+
id: step1
1718
uses: larsoner/circleci-artifacts-redirector-action@master
1819
with:
1920
repo-token: ${{ secrets.GITHUB_TOKEN }}
2021
artifact-path: 0/test_artifacts/root_artifact.md
2122
circleci-jobs: build_doc
23+
- name: Check the URL
24+
run: |
25+
curl --fail ${{ steps.step1.outputs.url }} | grep $GITHUB_SHA
26+
2227
```
2328
2429
- The `artifact-path` should point to an artifact path from your CircleCI

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ inputs:
1414
circleci-jobs:
1515
description: 'Comma-separated list of CircleCI jobs to monitor (default is "build_docs,build,doc")'
1616
required: false
17+
outputs:
18+
url:
19+
description: 'The full redirect URL'
1720
on: status
1821
runs:
1922
using: 'node12'

0 commit comments

Comments
 (0)