Skip to content

Warning

You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

Interact with Google Drive

Actions
Upload/Download files to/from Google Drive
v1.1.0
Star (87)

Tags

 (1)

action-google-drive

このアクションは指定されたディレクトリ、ファイルをGoogle Driveへアップロードします。

準備

Google Driveへのアップロードには、skickaを使用しています。 事前にトークンを作成し、Secretsに登録を行う必要があります。

トークンの作成

既にskickaを使っている場合

ユーザのホームディレクトリにある、.skicka.tokencache.jsonを、GitHubのリポジトリを開き、Settings → Secrets で、SKICKA_TOKENCACHE_JSONの名前等で、Valueに登録します。

それ以外

  1. Dockerが使用できる環境を用意し、以下のコマンドを実行します。
    docker run --rm -it --entrypoint "" satackey/skicka sh -c "skicka --no-browser-auth ls && cat /root/.skicka.tokencache.json"
  2. ブラウザで表示されたURLにアクセスします。
  3. アクセスを許可し、コード表示されたら、ターミナルに戻り貼り付けます。
  4. 最後の行に表示されたJSONを、GitHubのリポジトリを開き、Settings → Secrets で、SKICKA_TOKENCACHE_JSONの名前等で、Valueに登録します。

Inputs

skicka-tokencache-json

必須 skickaで生成された、アップロードするアカウントの認証情報。 (~/.skicka.tokencache.jsonの内容)

upload-from

任意 アップロード元。 デフォルトはカレントディレクトリ。

upload-to

必須 アップロード先。

remove-outdated

任意 ローカルにはないが、Google Drive上には存在するファイルを削除するかどうか。
'true''false'のどちらかの値
注意: ローカルに存在しないファイルを検出するため、1度ダウンロードを行うので、大きいファイルを含む操作を行う時はオフを推奨。

使用例

- name: Upload to Google Drive
  uses: satackey/action-google-drive@v1
  with:
    skicka-tokencache-json: ${{ secrets.SKICKA_TOKENCACHE_JSON }}
    upload-from: ./
    upload-to: /path/to/upload

Interact with Google Drive is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Upload/Download files to/from Google Drive
v1.1.0

Tags

 (1)

Interact with Google Drive is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.