From 54142d81371953aa0efeddaf9b8fa89c028d4188 Mon Sep 17 00:00:00 2001 From: dd di cesare Date: Mon, 17 Apr 2023 14:17:12 +0200 Subject: [PATCH] [gh workflow] Failing step when http response code is not 204 --- .github/workflows/update-stored-dependencies-version.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-stored-dependencies-version.yaml b/.github/workflows/update-stored-dependencies-version.yaml index 57b93ee69..53e350dc6 100644 --- a/.github/workflows/update-stored-dependencies-version.yaml +++ b/.github/workflows/update-stored-dependencies-version.yaml @@ -41,4 +41,7 @@ jobs: id: update run: | var=$(echo ${{ matrix.repository }} | sed -E 's/-/_/g;s/[a-z]/\U&/g')_SHA - curl -L -X PATCH "https://api.github.com/repos/Kuadrant/kuadrant-operator/actions/variables/${{steps.extract-sha-var.outputs.var}}" -H "X-GitHub-Api-Version: 2022-11-28" -H 'Authorization: Bearer ${{ secrets.UPDATE_ACTION_VARS_TOKEN }}' -H 'Accept: application/vnd.github+json' -d '{ "value": "${{ steps.extract-sha-var.outputs.sha }}" }' + http_code=$(curl --write-out "%{http_code}\n" -L -X PATCH "https://api.github.com/repos/Kuadrant/kuadrant-operator/actions/variables/${{steps.extract-sha-var.outputs.var}}" -H "X-GitHub-Api-Version: 2022-11-28" -H 'Authorization: Bearer ${{ secrets.UPDATE_ACTION_VARS_TOKEN }}' -H 'Accept: application/vnd.github+json' -d '{ "value": "${{ steps.extract-sha-var.outputs.sha }}" }') + if [[ $http_code != 204 ]]; then + exit 1 + fi