Skip to content

The sanity module is not installed in current project #21

@pwrstudio

Description

@pwrstudio

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/github-action-sanity@v0.7-alpha
        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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions