Skip to content

The execution of the node command seems to have failed #374

Closed
@d1y

Description

@d1y

Just a simple script to convert markdown files to html

my js code:

const markdown = require('markdown-it')
const path = require('path')
const fs = require('fs')

;(async ()=> {
  
  var filename = "源制作.md"
  var outputFilename = "source_create.html"
  var targetFile = path.join(__dirname, `../docs/${ filename }`)
  console.log("markdown file path is: ", targetFile)
  var md = markdown()
  var text = fs.readFileSync(targetFile).toString()
  var html = md.render(text)

  html = `<!-- 自动生成, 切勿删除 -->\n\n\n` + html

  var writeFilePath = path.join(__dirname, `../assets/data/${ outputFilename }`)
  console.log("create assets file path is: ", writeFilePath)
  fs.writeFileSync(writeFilePath, html)

})()

github action yml code:

jobs:
  release-to-gitHub:
    name: release
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-java@v1
        with:
          java-version: "12.x"
      - uses: subosito/flutter-action@v1
        with:
          flutter-version: "2.5.3"
          channel: "stable"
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
      - run: npm install markdown-it
      - run: node script/gen_source_create.js

the run logs: https://github.com/waifu-project/movie/actions/runs/1476944304

I don’t know where there is a problem. I can run it locally. I guess that node is not in the environment variable (PATH). From the running log, it can be seen that the execution to node script/gen_source_create.js Only used 0 s time

What happened, is it a problem with my operation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions