Skip to content

Suddenly began to fail with the error: path should be a path.relative()d string #248

@AF250329

Description

@AF250329

TL;DR

I've been using 'upload-cloud-storage' in multiple projects for a while now, and everything was fine until recently, when it began to fail with the following error:

Error: google-github-actions/upload-cloud-storage failed with path should be a `path.relative()`d string, but got "D:\a\project\archive.1.0.8132.27186-b6b5283.tar.gz"

Here is relevant parts in my Github workflow:

...
...
jobs:
    build:
        name: Compile and package
        runs-on: windows-latest
...
...
         -
            name: Collect UnitTests files
            id: collect-test-files
            env:
                PRODUCT_VERSION: ${{ steps.create-version-id.outputs.version }}
            run: |
                $fileName = "archive.$($env:PRODUCT_VERSION).tar.gz"

                Start-Process -NoNewWindow -FilePath 'tar.exe' -ArgumentList  "-cz", "-f $fileName", ".\UnitTestFiles" -Wait;

                $fileName = "$(Get-Location)\$fileName"

                Write-Host "::set-output name=unittest_file::$fileName"
        -
            name: Authenticate to Google Cloud
            uses: 'google-github-actions/auth@v0'
            with:
                credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
        -
            name: Upload to Google Storage bucket
            uses: 'google-github-actions/upload-cloud-storage@v0'
            with:
                path: '${{ steps.collect-test-files.outputs.unittest_file }}'
                destination: 'integration-tests-cache'
                parent: false

What I can do about it ?

Expected behavior

File should be uploaded to Google Storage even if provided absolute path and not just relative

Observed behavior

Upload process crashed with error and crashed the workflow

Action YAML

...
...
jobs:
    build:
        name: Compile and package
        runs-on: windows-latest
...
...
         -
            name: Collect UnitTests files
            id: collect-test-files
            env:
                PRODUCT_VERSION: ${{ steps.create-version-id.outputs.version }}
            run: |
                $fileName = "archive.$($env:PRODUCT_VERSION).tar.gz"

                Start-Process -NoNewWindow -FilePath 'tar.exe' -ArgumentList  "-cz", "-f $fileName", ".\UnitTestFiles" -Wait;

                $fileName = "$(Get-Location)\$fileName"

                Write-Host "::set-output name=unittest_file::$fileName"
        -
            name: Authenticate to Google Cloud
            uses: 'google-github-actions/auth@v0'
            with:
                credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
        -
            name: Upload to Google Storage bucket
            uses: 'google-github-actions/upload-cloud-storage@v0'
            with:
                path: '${{ steps.collect-test-files.outputs.unittest_file }}'
                destination: 'integration-tests-cache'
                parent: false



Sorry - it is a private repo - could not paste the whole workflow

Log output

No response

Additional information

I am running on Windows 2022 Github action runner

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions