From 62f7f3362c9b01488d683e38174b6c59cc656649 Mon Sep 17 00:00:00 2001 From: Henry Cai Date: Thu, 19 Dec 2024 16:04:27 -0800 Subject: [PATCH] docs: update the action example to simplify the steps and handle cancellation case --- README.md | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a04580f..7d6b198 100644 --- a/README.md +++ b/README.md @@ -53,22 +53,13 @@ jobs: run: | # add your deployment code here - - name: Update deployment status (success) - if: success() + - name: Update deployment status + if: always() uses: chrnorm/deployment-status@v2 with: token: '${{ github.token }}' environment-url: http://my-app-url.com - state: 'success' - deployment-id: ${{ steps.deployment.outputs.deployment_id }} - - - name: Update deployment status (failure) - if: failure() - uses: chrnorm/deployment-status@v2 - with: - token: '${{ github.token }}' - environment-url: http://my-app-url.com - state: 'failure' + state: ${{ job.status == 'cancelled' && 'inactive' || job.status }} deployment-id: ${{ steps.deployment.outputs.deployment_id }} ```