Code Monkey home page Code Monkey logo

google-drive-upload-git-action's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

google-drive-upload-git-action's Issues

v0.2 can not upload to gdrive

      - name: Upload to gdrive
        uses: adityak74/google-drive-upload-git-action@main
        with:
          credentials: ${{ secrets.GDRIVE_CREDENTIALS }}
          filename: "guwenguanzhi.epub"
          folderId: ${{ secrets.GDRIVE_FOLDER_ID }}
          name: "古文觀止.epub"
          overwrite: "true"

2022/07/12 06:44:30 Unable to retrieve files: googleapi: Error 404: File not found: ., notFound

Error: base64 decoding of 'credentials' failed with error: illegal base64 data at input byte 3168

HI,

I am using this action and everything seem to work when i use folderId and credentials as strings with "" :

     - name: Upload to G-Drive
        uses: adityak74/google-drive-upload-git-action@main
        with:
          credentials: "someverylongbase64string"
          filename: "${{ needs.zip_and_cache.outputs.CURRENT_VERSION }}/${{ needs.zip_and_cache.outputs.BUILD_NUMBER }}/VizAINotify-${{ needs.zip_and_cache.outputs.VERSION_WITH_BUILD_NUMBER }}.zip"
          folderId: "myFolderId"
          overwrite: "true"
          mirrorDirectoryStructure: "true"

So happy with the results i added two github action secrets as:

GOOGLE_UPLOAD_API_KEY =  someverylongbase64string
GOOGLE_UPLOAD_IOS_DRIVE =  myFolderId

and now when running:

 - name: Upload to G-Drive
      uses: adityak74/google-drive-upload-git-action@main
      with:
        credentials: ${{ secrets.GOOGLE_UPLOAD_API_KEY }}
        filename: "${{ needs.zip_and_cache.outputs.CURRENT_VERSION }}/${{ needs.zip_and_cache.outputs.BUILD_NUMBER }}/VizAINotify-${{ needs.zip_and_cache.outputs.VERSION_WITH_BUILD_NUMBER }}.zip"
        folderId: ${{ secrets.GOOGLE_UPLOAD_IOS_DRIVE }}
        overwrite: "true"
        mirrorDirectoryStructure: "true"

I get:

Error: base64 decoding of 'credentials' failed with error: illegal base64 data at input byte 3168

Is anyone familiar with such error ?

What should i do ?

Should i update my keys with "" ?

GOOGLE_UPLOAD_API_KEY =  "someverylongbase64string"
GOOGLE_UPLOAD_IOS_DRIVE =  "myFolderId"

Will appreciate any help 🙏🏻

Feature: support impersonation

Hi there,

I am using a service account to upload a backup of my database to drive. Using your default method, I run into upload quota because service accounts have their own, non-configurable upload quota. In order to use the upload qouta from my google business, I need to leverage impersonation. However, I can't use this with this action, because you need to configure this impersonation on code level, and there is no parameter available to do so currently.

In the meantime, I am using this action: https://github.com/Jumbo810/Upload_Github_Artifacts_TO_GDrive, which works fine but it seems a bit abandoned. I am using the owner parameter which does exactly what I want. Could you also implement this feature?

Issue to Stack Overflow for context: https://stackoverflow.com/questions/40535355/how-to-fix-the-storage-exceeded-issue-for-google-drive-when-uploading-using-serv

Breaking Bug: When uploading to multiple folders, the files in previous folders get deleted.

I have a bunch of repositories hooked up to different Google Drive folders, but using the same Google Cloud API to upload the files to.
The two files uploaded to each folder have the same name, the only difference is the folder.

When I update one repository and the Github Action pushes its files to that repository's folder, the previous versions of the file completely disappear. It looks like the action only creates one Google Drive ID per name.

Feature: add support to have the same file name in different folders

If you have the same file name in another folder inside de parent folder id and you want to upload another file but with the same name you get this error:

Overwriting file: ****
::error::creating/updating file failed with error: googleapi: Error 403: A shared drive item must have exactly one parent., teamDrivesParentLimit

I think that the problem is when is searching throught the drive for the filename, and then assumes that the file is the same but it's not true. Maybe if you have already the file in the drive, you have lucky and the search query returns the file that you want.

Unable to retrieve files: googleapi: Error 404: File not found: ., notFound

**> Run adityak74/google-drive-upload-git-action@main

/usr/bin/docker run --name b61ecae8ee7a346848db5631a69d3932e_710d25 --label 94351b --workdir /github/workspace --rm -e "JAVA_HOME_12.0.2_x64" -e "JAVA_HOME" -e "JAVA_HOME_12_0_2_X64" -e "FLUTTER_ROOT" -e "PUB_CACHE" -e "INPUT_CREDENTIALS" -e "INPUT_FILENAME" -e "INPUT_FOLDERID" -e "INPUT_NAME" -e "INPUT_OVERWRITE" -e "INPUT_MINETYPE" -e "INPUT_MIMETYPE" -e "INPUT_USECOMPLETESOURCEFILENAMEASNAME" -e "INPUT_MIRRORDIRECTORYSTRUCTURE" -e "INPUT_NAMEPREFIX" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/karmm_astro_app/karmm_astro_app":"/github/workspace" 94351b:61ecae8ee7a346848db5631a69d3932e
Files: [build/app/outputs/flutter-apk/app-release.apk]
useCompleteSourceFilenameAsName is disabled.
mirrorDirectoryStructure is disabled.
Processing file build/app/outputs/flutter-apk/app-release.apk
target file name: karmm.apk
2023/10/08 17:30:22 Unable to retrieve files: googleapi: Error 404: File not found: ., notFoundRun adityak74/google-drive-upload-git-action@main
/usr/bin/docker run --name b61ecae8ee7a346848db5631a69d3932e_710d25 --label 94351b --workdir /github/workspace --rm -e "JAVA_HOME_12.0.2_x64" -e "JAVA_HOME" -e "JAVA_HOME_12_0_2_X64" -e "FLUTTER_ROOT" -e "PUB_CACHE" -e "INPUT_CREDENTIALS" -e "INPUT_FILENAME" -e "INPUT_FOLDERID" -e "INPUT_NAME" -e "INPUT_OVERWRITE" -e "INPUT_MINETYPE" -e "INPUT_MIMETYPE" -e "INPUT_USECOMPLETESOURCEFILENAMEASNAME" -e "INPUT_MIRRORDIRECTORYSTRUCTURE" -e "INPUT_NAMEPREFIX" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/karmm_astro_app/karmm_astro_app":"/github/workspace" 94351b:61ecae8ee7a346848db5631a69d3932e
Files: [build/app/outputs/flutter-apk/app-release.apk]
useCompleteSourceFilenameAsName is disabled.
mirrorDirectoryStructure is disabled.
Processing file build/app/outputs/flutter-apk/app-release.apk
target file name: karmm.apk
2023/10/08 17:30:22 Unable to retrieve files: googleapi: Error 404: File not found: ., notFound**

429 (Too Many Requests) response from Google when uploading

Version used: main

Our build process uploads a 6GB tarball to GDrive. Recently and without any changes made, we started to receive this error:

Error: creating/updating file failed with error: googleapi: got HTTP response code 429 with body:

No body was output. The time between the previous log message ("No similar files found. Creating a new file") and the one above was ~7 minutes.

We're a paying GApps customer, so I doubt the size issue is the culprit. I also deleted some previous uploads in the same directory, made by the same API key -- an attempt to ensure that some sort of per-user, etc. limits are causing our problem. Didn't help, but I didn't expect it to either.

I presume the cause is either (1) some change to Google's throttling policies, or (2) an issue with how our account is set-up. I'm posting this to see if others have experienced this issue. No idea if there's a workaround that could be implemented in this action.

Feature: Remove non-existent files from drive

It would be great to have the option to delete files from the folder in the drive which aren't present locally when uploading. This would make it possible to effectively mirror a folder in the repository (or a build output folder). It would avoid having to manually delete files from the drive after they have been renamed.

V0.3 cannot upload file - Error 404 returned

My action script

name: On Push Run

on: push

jobs:
  install_conda:
    runs-on: ubuntu-latest
    steps:
      - name: Upload to gdrive
        uses: adityak74/google-drive-upload-git-action@main
        with:
          credentials: ${{ secrets.GDRIVE_CREDENTIALS }}
          filename: "file.pdf"
          folderId: ${{ secrets.GDRIVE_FOLDER_ID }}
          overwrite: "true" # optional boolean

And I'm getting this message
2022/12/07 20:34:53 Unable to retrieve files: googleapi: Error 404: File not found: ., notFound.

Other info

  • The file exists in the root folder;
  • The GDRIVE_FOLDER_ID is acessible since I use it in another Python project;
  • The service account is cofigured as owner.

Feature: add support for Windows runners

Simplest workflow:

name: make something useful

on: [workflow_dispatch]

jobs:
  build:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v3
      - name: Build Installer executable
        run: |
          cd 'Installer'
          makensis installer.nsi
      - uses: adityak74/google-drive-upload-git-action@main
        with:
          credentials: ${{ secrets.SERVICE_ACCOUNT_KEY_JSON_BASE64 }}
          filename: 'installer.exe'
          folderId: ${{ secrets.FILE_GDRIVE_FOLDER_ID }}
          overwrite: "true"
          mirrorDirectoryStructure: "true"

Failing with:

Run adityak7[4](https://github.com/mvcaaa/installer/actions/runs/nnnnnnnnnnnn/jobs/mmmmmmmm#step:13:4)/google-drive-upload-git-action@main
  with:
    credentials: ***
    filename: Installer.exe
    folderId: ***
    overwrite: true
    mirrorDirectoryStructure: true
Error: Container action is only supported on Linux

Add support windows based jobs

I have a job in the workflow that runs on a windows machine. In this job I build a wpf windows application.
I would like to add a step in that job that deploys the build artifacts to Google Drive.
Unfortunately, this provided GitHub Action does not work in a windows based job.
Can we have this Github Action to work also in a windows based job?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.