sanity-io / github-action-sanity

MIT License
57 stars 20 forks source link

when using the modul I get "Error: Command "dataset" is not available outside of a Sanity project context." #10

Open devopsweep opened 2 years ago

devopsweep commented 2 years ago

Hi, when I use the workflow you published:

jobs:
  backup-dataset:
    runs-on: ubuntu-18.04
    name: Backup dataset
    steps:
      - uses: actions/checkout@v2
      - name: Export dataset
        uses: sanity-io/github-action-sanity@v0.3
        env:
          SANITY_AUTH_TOKEN: ${{ secrets.SANITY_AUTH_TOKEN }}
        with:
          args: . dataset export production backups/backup.tar.gz
      - name: Upload backup.tar.gz
        uses: actions/upload-artifact@v2
        with:
          name: backup-tarball
          path: backups/backup.tar.gz
          # Fails the workflow if no files are found; defaults to 'warn'
          if-no-files-found: error

I get this error on each: Error: Command "dataset" is not available outside of a Sanity project context.

saifmahamood commented 4 months ago

Faced the same issue today.

The `sanity` module is not installed in current project
Project-specific commands not available until you run `npm install`
Error: Command "deploy" is not available outside of a Sanity project context.
Run the command again within a Sanity project directory, where "sanity"
is installed as a dependency.
    at CommandRunner.runCommand (/usr/local/share/.config/yarn/global/node_modules/@sanity/cli/lib/_chunks-cjs/cli.js:71721:13)
    at Object.runCli (/usr/local/share/.config/yarn/global/node_modules/@sanity/cli/lib/_chunks-cjs/cli.js:7210[8](https://github.com/shafi-fiqh/inheritance-sanity/actions/runs/10104330217/job/27943137119#step:4:9):38)