Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
arrow-up-circle

GitHub Action

Clasp Action

v1.0.1

Clasp Action

arrow-up-circle

Clasp Action

Push or deploy to Google Apps Script using clasp

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Clasp Action

uses: daikikatsuragawa/[email protected]

Learn more about this action in daikikatsuragawa/clasp-action

Choose a version

Clasp Action

This action uses clasp to push or deploy to Google Apps Script. This action is running clasp push -f regardless of whether you select push or deploy as the command. This will force the remote manifest to be overwritten.

Inputs

accessToken

Required access_token written in .clasprc.json.

idToken

Required id_token written in .clasprc.json.

refreshToken

Required refresh_token written in .clasprc.json.

clientId

Required refresh_token written in .clasprc.json.

clientSecret

Required clientSecret written in .clasprc.json.

scriptId

Required scriptId written in .clasp.json.

rootDir

Directory where scripts are stored.

command

Required Command to execute(push or deploy).

If deploy is selected, this action is running clasp push -f just before.

Deploy works for max. 20 deployments due to Gas limit on active deployments and complexity to determine which deployment should be deleted. Workaround : Archive manually all your unecessary deployments. If you want to fix this

description

Description of the deployment.

Example usage

Case to push

- uses: daikikatsuragawa/clasp-action@v1
  with:
    accessToken: ${{ secrets.ACCESS_TOKEN }}
    idToken: ${{ secrets.ID_TOKEN }}
    refreshToken: ${{ secrets.REFRESH_TOKEN }}
    clientId: ${{ secrets.CLIENT_ID }}
    clientSecret: ${{ secrets.CLIENT_SECRET }}
    scriptId: ${{ secrets.SCRIPT_ID }}
    command: 'push'

Case to deploy

- uses: daikikatsuragawa/clasp-action@v1
  with:
    accessToken: ${{ secrets.ACCESS_TOKEN }}
    idToken: ${{ secrets.ID_TOKEN }}
    refreshToken: ${{ secrets.REFRESH_TOKEN }}
    clientId: ${{ secrets.CLIENT_ID }}
    clientSecret: ${{ secrets.CLIENT_SECRET }}
    scriptId: ${{ secrets.SCRIPT_ID }}
    command: 'deploy'

Case to deploy with description

- uses: daikikatsuragawa/clasp-action@v1
  with:
    accessToken: ${{ secrets.ACCESS_TOKEN }}
    idToken: ${{ secrets.ID_TOKEN }}
    refreshToken: ${{ secrets.REFRESH_TOKEN }}
    clientId: ${{ secrets.CLIENT_ID }}
    clientSecret: ${{ secrets.CLIENT_SECRET }}
    scriptId: ${{ secrets.SCRIPT_ID }}
    command: 'deploy'
    description: 'Sample description'

Case to specify the directory where scripts are stored

- uses: daikikatsuragawa/clasp-action@v1
  with:
    accessToken: ${{ secrets.ACCESS_TOKEN }}
    idToken: ${{ secrets.ID_TOKEN }}
    refreshToken: ${{ secrets.REFRESH_TOKEN }}
    clientId: ${{ secrets.CLIENT_ID }}     
    clientSecret: ${{ secrets.CLIENT_SECRET }}
    scriptId: ${{ secrets.SCRIPT_ID }}
    rootDir: 'src'
    command: 'push'

License summary

This code is made available under the MIT license.