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

Storyblok CLI in CI/CD Environment #124

Open
christophsaile opened this issue Oct 7, 2024 · 0 comments
Open

Storyblok CLI in CI/CD Environment #124

christophsaile opened this issue Oct 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@christophsaile
Copy link

christophsaile commented Oct 7, 2024

Hello, I want to generate types for my storyblok project using the storyblok cli. In order to have my types in sync I want to create a github action that generates types on every PR.

Current behavior:
Currently I am having issues using the storyblok cli in my github action.
When I run the action listed below, my workflow throws the following error:

 Hi, welcome to the Storyblok CLI

? Enter your email address: 
Error: Process completed with exit code 130.

When I run the same command from my local terminal everything seems to work.
Looks like in a CI/CD env the --token flag does not skip the prompt

Expected behavior:
Running the storyblok cli for generating types works in a CI/CD env the same way as it does in a local env.

Steps to reproduce:
https://github.com/christophsaile/next-storyblok

Related code:

name: Install Node.js and Storyblok CLI

on:
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3

      # Install Storyblok CLI
      - name: Install Storyblok CLI
        run: |
          npm install -g storyblok-cli

      # Storyblok login using the PAT from an environment variable (GitHub Secret)
      - name: Storyblok login
        run: storyblok login --token ${{ secrets.STORYBLOK_PAT }} --region eu

      # Pull Storyblok components
      - name: pull-sb-components
        run: storyblok pull-components --space 307181

      # Generate TypeScript types
      - name: generate-sb-type
        run: storyblok generate-typescript-typedefs --sourceFilePaths ./components.307181.json --destinationFilePath ./component-types-sb.d.ts

I was not able to find an example, guide or documentation how to use the cli in a CI/CD env, thats's why I opend this issue.
Thanks in advance for your support :)

@christophsaile christophsaile added the bug Something isn't working label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant