diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e5ad3ef..0bc0bd7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,7 +7,7 @@ on: jobs: test-action: runs-on: nix - name: Tests that the action works as expected + name: Upload and download test steps: - name: Create sample file run: echo "Hello, world!" > test.txt diff --git a/index.js b/index.js index e3bcf29..59a8729 100644 --- a/index.js +++ b/index.js @@ -42,7 +42,13 @@ try { 'x-salt-name': use_salt ? 'true' : 'false', 'authorization': `Bearer ${token}` } - }).then(response => { return response.text() }) + }).then(response => { + if (!response.ok) { + console.log("Got response: ", response) + throw new Error(`HTTP error! status: ${response.status}`); + } + return response.text() + }) .then(uri => { console.log("Uploaded to: ", uri) core.setOutput('uri', uri)