From 65c1647e721b5c54d14c0ebc3bf6cea5335b3b75 Mon Sep 17 00:00:00 2001 From: Konrad Pabjan Date: Thu, 17 Aug 2023 12:08:33 -0400 Subject: [PATCH] Try using github-script --- .github/workflows/artifact-tests.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/artifact-tests.yml b/.github/workflows/artifact-tests.yml index ed775315..64e89646 100644 --- a/.github/workflows/artifact-tests.yml +++ b/.github/workflows/artifact-tests.yml @@ -59,10 +59,9 @@ jobs: echo '${{ env.file1 }}' > artifact-path/first.txt echo '${{ env.file2 }}' > artifact-path/second.txt - # We're using node -e to call the functions directly available in the @actions/artifact package - - name: Upload artifacts using uploadArtifact() - run: | - node -e "Promise.resolve(require('./packages/artifact/lib/artifact').create().uploadArtifact('my-artifact-${{ matrix.runs-on }}',['artifact-path/first.txt','artifact-path/second.txt'], process.argv[1]))" "${{ github.workspace }}" - - - + - uses: actions/github-script@v6 + with: + script: | + const script = require('./packages/artifact/lib/artifact') + const uploadResult = await script.create().uploadArtifact('my-artifact-${{ matrix.runs-on }}',['artifact-path/first.txt','artifact-path/second.txt'], ${{ github.workspace }}) +