google / google/clasp

Feature Request: Add WebAppConfig support to clasp deploy (access permission)

Open
#1,115 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.8k
Forks
510
Avg merge
5h 27m
Merged PRs (30d)
1

Description

## Summary

`clasp deploy` does not set `WebAppConfig` (access permission, executeAs) even though the Google Apps Script API supports it. This forces users to manually configure access permissions via the Script Editor UI for every new deployment.

## Current Behavior

```bash
clasp deploy -d "My deployment"
# Creates deployment but access = MYSELF (default)
# User must open Script Editor > Deploy > Manage > Edit access
```

## Expected Behavior

```bash
clasp deploy -d "My deployment" --access ANYONE --executeAs USER_DEPLOYING
# Creates deployment with specified access permission
```

Or via `appsscript.json`:

```json
{
"webapp": {
"access": "ANYONE",
"executeAs": "USER_DEPLOYING"
}
}
```

## Technical Analysis

The [Apps Script API](https://developers.google.com/apps-script/api/reference/rest/v1/projects.deployments) supports `WebAppConfig` in `entryPoints`:

```javascript
// API supports this
{
deploymentConfig: { versionNumber, manifestFileName },
entryPoints: [{
entryPointType: 'WEB_APP',
webApp: {
entryPointConfig: {
access: 'ANYONE_ANONYMOUS',
executeAs: 'USER_DEPLOYING'
}
}
}]
}
```

However, [clasp's implementation](https://github.com/google/clasp/blob/master/src/core/project.ts) only sends:

```javascript
// What clasp currently sends
{
description,
versionNumber,
manifestFileName: 'appsscript'
// entryPoints is missing
}
```

## Related Issues

- #63 (open since 2017) - discusses the same root cause
- The "API support needed" label on #63 appears outdated; the API has supported this for years

## Proposed Solution

1. Read `webapp` config from `appsscript.json`
2. Add CLI options: `--access` and `--executeAs`
3. Pass `entryPoints` to `script.projects.deployments.create()`

I'm willing to submit a PR if this approach is acceptable.

## Environment

- clasp version: latest
- Discovered while building a CI/CD pipeline for GAS Web Apps

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.