From 532461edc14668873fcc7522a06cc734055b1557 Mon Sep 17 00:00:00 2001 From: Limon Monte Date: Sun, 13 Oct 2019 22:21:48 +0300 Subject: [PATCH] Add information on how to run when the previous step failed --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index fea2680..0ba6d71 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,17 @@ steps: path: path/to/artifact ``` +To upload artifacts only when the previous step of a job failed, use [`if: failure()`](https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#job-status-check-functions): + +```yaml +- uses: actions/upload-artifact@master + if: failure() + with: + name: my-artifact + path: path/to/artifact +``` + + ## Where does the upload go? In the top right corner of a workflow run, once the run is over, if you used this action, there will be a `Artifacts` dropdown which you can download items from. Here's a screenshot of what it looks like
![Artifacts Screenshot](https://user-images.githubusercontent.com/3685876/62906968-1b4aff80-bd3f-11e9-8815-9058eb05692a.png)