-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: set
outputs.status
in case of an error (#92)
* docs(README): handle errors * test: handle errors * feat: set `outputs.status` in case of an error * fixup! test: handle errors * fixup! test: handle errors
- Loading branch information
Showing
3 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,32 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
|
||
Handle errors | ||
|
||
``` | ||
name: Log latest release | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
handleError: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: octokit/request-[email protected] | ||
id: get_release | ||
with: | ||
route: GET /repos/{owner}/{repo}/releases/v0.9.9 | ||
owner: octokit | ||
repo: request-action | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- run: "Release found: ${{ steps.get_release.outputs.data }}" | ||
- name: "Release cound not be found. Request failed with status ${{ steps.get_release.outputs.status }} | ||
if: ${{ failure() }} | ||
``` | ||
## Inputs | ||
To use request body parameters, simply pass in an `input` matching the parameter name. See previous examples. | ||
|
@@ -89,7 +115,7 @@ env: | |
with: | ||
# As JSON | ||
body: ${{ toJSON(env.REQUEST_BODY) }} | ||
# As block scalar | ||
body: | | ||
| | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters