0

I have a design token JSON file (written to the standards spec). I have written a GitHub Action to transform the JSON into CSS variables using a NPM dependency called Design Tokens CLI. I just want it to run an NPM script and then publish the output CSS file the script generates to the NPM registry. The npm run tokenize script does the transpilation.

name: CI

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 12
      - run: npm install
      - run: npm run tokenize
      - uses: JS-DevTools/npm-publish@v1
        with:
          token: ${{ secrets.NPM_ACCESS_TOKEN }}

This is the first time I've written an action and I don't really know what I'm doing. I am getting the following error:

/home/runner/work/tokens-test/tokens-test/node_modules/fs-jetpack/lib/find.js:50
  const err = new Error(`Path you want to find stuff in doesn't exist ${path}`);
              ^

Error: Path you want to find stuff in doesn't exist /home/runner/work/tokens-test/tokens-test/example/tokens-layout
    at generatePathDoesntExistError (/home/runner/work/tokens-test/tokens-test/node_modules/fs-jetpack/lib/find.js:50:15)
    at Object.findSyncInit [as sync] (/home/runner/work/tokens-test/tokens-test/node_modules/fs-jetpack/lib/find.js:111:11)
    at Object.find (/home/runner/work/tokens-test/tokens-test/node_modules/fs-jetpack/lib/jetpack.js:138:19)
    at file:///home/runner/work/tokens-test/tokens-test/node_modules/design-tokens-cli/utils/transform.js:23:10
    at Array.forEach (<anonymous>)
    at Command.transform (file:///home/runner/work/tokens-test/tokens-test/node_modules/design-tokens-cli/utils/transform.js:19:21)
    at Command.listener [as _actionHandler] (/home/runner/work/tokens-test/tokens-test/node_modules/commander/lib/command.js:482:17)
    at /home/runner/work/tokens-test/tokens-test/node_modules/commander/lib/command.js:1264:65
    at Command._chainOrCall (/home/runner/work/tokens-test/tokens-test/node_modules/commander/lib/command.js:1158:12)
    at Command._parseCommand (/home/runner/work/tokens-test/tokens-test/node_modules/commander/lib/command.js:1264:27) {
  code: 'ENOENT'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tokens@1.0.0 tokenize: `designTokens transform`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the tokens@1.0.0 tokenize script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2022-10-06T18_20_19_895Z-debug.log
Error: Process completed with exit code 1.
Ollie Williams
  • 1,996
  • 3
  • 25
  • 41
  • You are running it in the wrong path as the error says: `Path you want to find stuff in doesn't exist`. Where are the files located in your repository? Are they in a subfolder or something ? – Grzegorz Krukowski Oct 07 '22 at 16:25

0 Answers0