Using Github Actions to import/export datasets with authentication on Sanity.io

8 replies
Last updated: Apr 29, 2020
I want to do some dataset imports and exports using github actions, and I'm trying to figure out how to authenticate so that I can run cli commands.
Apr 29, 2020, 6:45 PM
Hi Alex, you can run your commands with a token that you can create on manage.sanity.io ๐Ÿ™‚ Go to Settings > API > Add new token.
You can then add this as SANITY_AUTH_TOKEN to your env.
Apr 29, 2020, 7:30 PM
oooo, you add the auth token to the command
Apr 29, 2020, 7:31 PM
Would you mind posting an example?
Apr 29, 2020, 7:33 PM
SANITY_AUTH_TOKEN=<yourtoken> sanity <yourcommand>
Apr 29, 2020, 7:33 PM
AH
Apr 29, 2020, 7:33 PM
amazing
Apr 29, 2020, 7:33 PM
thank you so much!
Apr 29, 2020, 7:33 PM
sanity is great
Apr 29, 2020, 7:33 PM

Sanityโ€“ build remarkable experiences at scale

The Sanity Composable Content Cloud is the headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?

Categorized in