Skip to content

The sanity module is not installed in current project #21

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

Open
pwrstudio opened this issue Nov 28, 2023 · 1 comment
Open

The sanity module is not installed in current project #21

pwrstudio opened this issue Nov 28, 2023 · 1 comment

Comments

@pwrstudio
Copy link

Similar to #10

When running the backup action I get the following error:

The `sanity` module is not installed in current project
Project-specific commands not available until you run `npm install`

Error: Command "dataset" 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.

This is the workflow file:

name: Backup Routine
on:
  schedule:
    - cron: '0 4 * * 1'
  workflow_dispatch:
jobs:
  backup-dataset:
    runs-on: ubuntu-latest
    name: Backup dataset
    steps:
      - uses: actions/checkout@v2
      - name: Export dataset
        uses: sanity-io/[email protected]
        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

Action is added to the repo of the studio:
https://github.com/pwrstudio/sat02-admin

@doesnotexist
Copy link

Running npm install or yarn install after checking out your project should fix that, like so:

name: Backup Routine
on:
  schedule:
    - cron: '0 4 * * 1'
  workflow_dispatch:
jobs:
  backup-dataset:
    runs-on: ubuntu-latest
    name: Backup dataset
    steps:
      - uses: actions/checkout@v2
      - run: yarn install
      - name: Export dataset
        uses: sanity-io/[email protected]
        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

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

2 participants