JasonEtco / build-and-tag-action

📦🔖 A GitHub Action for publishing JavaScript Actions
MIT License
92 stars 38 forks source link

Add support to make yarn usable in setup field #3

Closed smorimoto closed 4 years ago

smorimoto commented 4 years ago
/usr/bin/yarn --frozen-lockfile && yarn build
yarn run v1.22.4
error Command "&&" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
##[error]The process '/usr/bin/yarn' failed with exit code 1
✖  fatal     Error: The process '/usr/bin/yarn' failed with exit code 1 
    at ExecState._setResult (/home/runner/work/_actions/JasonEtco/build-and-tag-action/v1/dist/index.js:16755:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/JasonEtco/build-and-tag-action/v1/dist/index.js:16738:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/JasonEtco/build-and-tag-action/v1/dist/index.js:16632:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
JasonEtco commented 4 years ago

Can you share your whole workflow file? This isn’t a problem with yarn.

smorimoto commented 4 years ago

This doesn't work.

name: Main workflow

on:
  release:
    types:
      - edited
      - published

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Use Node.js 14.x
        uses: actions/setup-node@v1
        with:
          node-version: 14.x

      - name: Publish action
        uses: JasonEtco/build-and-tag-action@v1
        with:
          setup: "yarn --frozen-lockfile && yarn build"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JasonEtco commented 4 years ago

That’s not your whole workflow file. Please share the entire file or I can’t help you.

smorimoto commented 4 years ago

The problem is probably due to Node.js specific unique behavior due to the lack of yarn subcommands, so I don't think the entire workflow is necessary. Anyway, I updated that.

JasonEtco commented 4 years ago

There's currently a problem with @actions/exec and multiple commands (using &&), see #4 and https://github.com/actions/toolkit/issues/461. Still, this sounds like something different - but also not something that this action is doing wrong. I'm going to close this because there's nothing we can do here.

smorimoto commented 4 years ago

Indeed.