upload-cloud-storage icon indicating copy to clipboard operation
upload-cloud-storage copied to clipboard

Action does not handle inverted folders well

Open velddev opened this issue 1 year ago • 1 comments

TL;DR

When running gcloud meta list-files-for-upload with the current .gcloudignore i get the following result:

# Ignore everything
*

# Except the Cloud Function files we want to deploy
!/assets/**
!/build/**
!*.html
index.html
assets\my-style.css
build\index.js

However, gcloud only uploads the specific file "index.html"

Expected behavior

For gcloud meta list-files-for-upload to confidently show me what files I will be uploading regardless of implementation

Observed behavior

Inconsistent behavior

Action YAML

name: Build

jobs:
  test:
    name: Upload App
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v3
        with:
          lfs: true

      - id: 'auth'
        name: 'Authenticate to Google Cloud'
        uses: 'google-github-actions/auth@v1'
        with:
          credentials_json: '${{ secrets.MY_GITHUB_KEY }}'

      - name: Install Node Modules
        run: yarn install --frozen-lockfile

      - name: Run esbuild
        run: yarn build:prod

      - id: 'upload-file'
        uses: 'google-github-actions/upload-cloud-storage@v1'
        with:
          path: '.'
          destination: 'my-app/${{ github.head_ref || github.ref_name }}'
          parent: false

Log output

It shows build/index.js is there, but is ignored by the ignorefile.

Additional information

No response

velddev avatar Aug 22 '23 18:08 velddev

Hi there - could you please provide the debug output for the complete GitHub Actions workflow run?

Does running the raw gcloud storage objects cp or gsutil work as expected?

sethvargo avatar Aug 22 '23 18:08 sethvargo