github.com/nektos/act@v0.2.63-0.20240520024548-8acde99bfa9c/pkg/artifacts/testdata/GHSL-2023-004/artifacts.yml (about)

     1  
     2  name: "GHSL-2023-0004"
     3  on: push
     4  
     5  jobs:
     6    test-artifacts:
     7      runs-on: ubuntu-latest
     8      steps:
     9        - run: echo "hello world" > test.txt
    10        - name: curl upload
    11          run: curl --silent --show-error --fail ${ACTIONS_RUNTIME_URL}upload/1?itemPath=../../my-artifact/secret.txt --upload-file test.txt
    12        - uses: actions/download-artifact@v2
    13          with:
    14            name: my-artifact
    15            path: test-artifacts
    16        - name: 'Verify Artifact #1'
    17          run: |
    18            file="test-artifacts/secret.txt"
    19            if [ ! -f $file ] ; then
    20              echo "Expected file does not exist"
    21              exit 1
    22            fi
    23            if [ "$(cat $file)" != "hello world" ] ; then
    24              echo "File contents of downloaded artifact are incorrect"
    25              exit 1
    26            fi
    27        - name: Verify download should work by clean extra dots
    28          run: curl --silent --show-error --fail --path-as-is -o out.txt ${ACTIONS_RUNTIME_URL}artifact/1/../../../1/my-artifact/secret.txt
    29        - name: 'Verify download content'
    30          run: |
    31            file="out.txt"
    32            if [ ! -f $file ] ; then
    33              echo "Expected file does not exist"
    34              exit 1
    35            fi
    36            if [ "$(cat $file)" != "hello world" ] ; then
    37              echo "File contents of downloaded artifact are incorrect"
    38              exit 1
    39            fi