Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENOENT: no such file or directory, open '/appsscript.json' #9

Open
isaiahdaviscom opened this issue Nov 16, 2022 · 2 comments
Open

Comments

@isaiahdaviscom
Copy link

isaiahdaviscom commented Nov 16, 2022

Run daikikatsuragawa/[email protected]
  with:
    accessToken: ***
    idToken: ***
    refreshToken: ***
    clientId: ***
    clientSecret: ***
    scriptId: ***
    rootDir: ***
    command: push
##[debug]Evaluating: inputs.accessToken
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'accessToken'
##[debug]=> '***'

I am passing GitHub Secrets as arguments for all the required fields of this Action.

The Action runs on changes to the main branch.

The main branch structure has the Action main.yml file under /.github/workflows.

When the main.yml file is executed the following error occurs at runtime:

ENOENT: no such file or directory, open '/appsscript.json'

The /appscript.json file is located at the root directory.

I attempted to replace the GitHub Secret for the object rootDir to a string literal, but with no resolve.

@alex-galey
Copy link
Contributor

This is how I achieved autodeploying to GAS :

Github workflow - deploy.yml

name: Deploy

on:
  push:
    branches: [ main ]

jobs:
  deploy:
    if: ${{ github.actor != 'dependabot' }}
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Use Node 16
      uses: actions/setup-node@v2
      with:
        node-version: 16.x
        cache: 'npm'

    - name: Install npm packages
      run: npm install

    - name: Create clasp.json
      env:
        SCRIPT_ID: ${{ secrets.SCRIPT_ID }}
      run: echo '{"scriptId":"'$SCRIPT_ID'","rootDir":"dist"}' > .clasp.json

    - name: Create folder structure
      run: mkdir -p /home/runner

    - name: Create clasprc.json
      env:
        CLASPRC: ${{ secrets.CLASPRC }}
      run: echo "$CLASPRC" > /home/runner/.clasprc.json
  
    - name: Deploy
      run: npm run deploy

Scripts in package.json :

  "scripts": {
    "build": "webpack",
    "upload": "npx clasp push -f",
    "deploy": "npm run build && npm run upload",
  }

With clasp has a dev dependency

@maariavld
Copy link

@isaiahdaviscom maybe you fixed it by now, but there is a typo in your file name. I also encountered the same issue, the correct file name is appsscript.json with a double s as the error says.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants