Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Commit

Permalink
Make Review App URL available for other steps in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
suryasr007 committed Feb 13, 2020
1 parent 72660e0 commit 3d8fa38
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ A Github Action that tests the deployment status of a Heroku Review App.

steps:
- name: Run review-app test
uses: niteoweb/[email protected]
id: review_app_test # `id` value is used to refer the outputs from the corresponding action
uses: niteoweb/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -46,6 +47,11 @@ A Github Action that tests the deployment status of a Heroku Review App.

# Max time to be spent retrying for the response check, default is 120
publish_timeout: 120

# `steps.review_app_test.outputs.review_app_url` must be used in workflow to fetch the Review App URL
- name: Check review_app_url
run: |
echo "Outputs - ${{ steps.review_app_test.outputs.review_app_url }}"
```
> Note: Work flow should include `pull_request` event.
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ inputs:
description: Maximum time to spend retrying the HTTP response check until it succeeds.
required: false
default: 120

outputs:
review_app_url:
description: "Review App URL from the action."
1 change: 1 addition & 0 deletions review_app_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ def main() -> None:
interval=args.interval,
)

print(f"::set-output name=review_app_url::{review_app_url}")
print("Successful")


Expand Down
2 changes: 2 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ def test_main_success(
)

out, err = capsys.readouterr()

"set-output name=review_app_url::https://foo-pr-bar.herokuapp.com" in out
"Successful" in out


Expand Down

0 comments on commit 3d8fa38

Please sign in to comment.