Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/namaggarwal/clasp-token-action
This sets up clasp tokens for pushing and deploying project to Google App Script
https://github.com/namaggarwal/clasp-token-action
Last synced: 4 months ago
JSON representation
This sets up clasp tokens for pushing and deploying project to Google App Script
- Host: GitHub
- URL: https://github.com/namaggarwal/clasp-token-action
- Owner: namaggarwal
- License: mit
- Created: 2020-04-26T07:32:31.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T02:57:53.000Z (over 1 year ago)
- Last Synced: 2024-02-16T22:21:26.108Z (4 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 20
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- google-apps-script-awesome-list - namaggarwal/clasp-token-action
- google-apps-script-awesome-list_contributorpw - namaggarwal/clasp-token-action
README
# Clasp Token Action
This action allows you to create `.clasprc.json` file in the home directory. This is needed to push projects in Google App Script.
## Inputs
### `client-id`
**Required** The ClientID of the project.
### `client-secret`
**Required** The ClientSecret of the project.
### `refresh-token`
**Required** RefreshToken of the user.
## How to get the value of the inputs
You need to install clasp locally to get the values.
* Install clasp
```
npm install -g @google/clasp
```* Enable the Google Apps Script API
https://script.google.com/home/usersettings* Create Clasp.json locally
Create clasp.json file locally in your project with scriptID from AppScript console.clasp.json
```
{"scriptId":"1R7XTv-sdhsdjhsjhsjhjsfgdhdgfshgdsfhdfhs"}
```* Login to clasp
```
clasp login
```* Get values from local file
```
cat ~/.clasprc.json
```## Example usage
```
uses: namaggarwal/[email protected]
with:
client-id: test-client-id
client-secret: test-client-secret
refresh-token: test-refresh-token
```You can specify the clasp command in your npm scripts. For example
package.json
```
{
"name": "my-project",
"version": "0.0.1",
"script": {
"push-to-app": "clasp push"
}
}
```