From 24348ff1eec2ba2bec4a29fd4d544cb1788c9a1e Mon Sep 17 00:00:00 2001 From: Jason Song Date: Wed, 14 Jun 2023 05:24:31 +0800 Subject: [PATCH] Drop disappeared `wei/curl@v1` (#1864) * chore: trigger actions * fix: use curl command directly * fix: use node:16-buster * fix: remove --fail-with-body * chore: format codes --- pkg/artifacts/server_test.go | 15 +++++++++------ .../testdata/GHSL-2023-004/artifacts.yml | 8 ++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pkg/artifacts/server_test.go b/pkg/artifacts/server_test.go index 943820ca..aeeb0598 100644 --- a/pkg/artifacts/server_test.go +++ b/pkg/artifacts/server_test.go @@ -14,10 +14,11 @@ import ( "testing/fstest" "github.com/julienschmidt/httprouter" - "github.com/nektos/act/pkg/model" - "github.com/nektos/act/pkg/runner" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + + "github.com/nektos/act/pkg/model" + "github.com/nektos/act/pkg/runner" ) type writableMapFile struct { @@ -238,9 +239,11 @@ type TestJobFileInfo struct { containerArchitecture string } -var artifactsPath = path.Join(os.TempDir(), "test-artifacts") -var artifactsAddr = "127.0.0.1" -var artifactsPort = "12345" +var ( + artifactsPath = path.Join(os.TempDir(), "test-artifacts") + artifactsAddr = "127.0.0.1" + artifactsPort = "12345" +) func TestArtifactFlow(t *testing.T) { if testing.Short() { @@ -253,7 +256,7 @@ func TestArtifactFlow(t *testing.T) { defer cancel() platforms := map[string]string{ - "ubuntu-latest": "node:16-buster-slim", + "ubuntu-latest": "node:16-buster", // Don't use node:16-buster-slim because it doesn't have curl command, which is used in the tests } tables := []TestJobFileInfo{ diff --git a/pkg/artifacts/testdata/GHSL-2023-004/artifacts.yml b/pkg/artifacts/testdata/GHSL-2023-004/artifacts.yml index e717f141..ec801c35 100644 --- a/pkg/artifacts/testdata/GHSL-2023-004/artifacts.yml +++ b/pkg/artifacts/testdata/GHSL-2023-004/artifacts.yml @@ -8,9 +8,7 @@ jobs: steps: - run: echo "hello world" > test.txt - name: curl upload - uses: wei/curl@v1 - with: - args: -s --fail ${ACTIONS_RUNTIME_URL}upload/1?itemPath=../../my-artifact/secret.txt --upload-file test.txt + run: curl --silent --show-error --fail ${ACTIONS_RUNTIME_URL}upload/1?itemPath=../../my-artifact/secret.txt --upload-file test.txt - uses: actions/download-artifact@v2 with: name: my-artifact @@ -27,9 +25,7 @@ jobs: exit 1 fi - name: Verify download should work by clean extra dots - uses: wei/curl@v1 - with: - args: --path-as-is -s -o out.txt --fail ${ACTIONS_RUNTIME_URL}artifact/1/../../../1/my-artifact/secret.txt + run: curl --silent --show-error --fail --path-as-is -o out.txt ${ACTIONS_RUNTIME_URL}artifact/1/../../../1/my-artifact/secret.txt - name: 'Verify download content' run: | file="out.txt"