[GH-ISSUE #280] [BUG] Can't use yarn #196

Closed
opened 2026-03-01 21:41:07 +03:00 by kerem · 15 comments
Owner

Originally created by @LKay on GitHub (Jun 17, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/280

Whenever I try to call any yarn command the act returns an error and fails to execute: Failed to replace env in config: ${{ inputs.auth-token }. I tried to search trough existing issues, over the internet and nothing with this exact error pops up.

Originally created by @LKay on GitHub (Jun 17, 2020). Original GitHub issue: https://github.com/nektos/act/issues/280 Whenever I try to call any `yarn` command the `act` returns an error and fails to execute: `Failed to replace env in config: ${{ inputs.auth-token }`. I tried to search trough existing issues, over the internet and nothing with this exact error pops up.
kerem 2026-03-01 21:41:07 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@Sumolari commented on GitHub (Aug 2, 2020):

This happened to me, too.

Here's a sample workflow I'm trying to run:

name: Lint and test

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2
      - name: NPM or Yarn install with caching
        uses: bahmutov/npm-install@v1.1.0
      - name: Run tests
        uses: Borales/actions-yarn@v2.3.0
        with:
          cmd: test
          auth-token: ${{ secrets.NPM_AUTH_TOKEN }}

And I try to run it using:

act -s NPM_AUTH_TOKEN=<MY_TOKEN_HERE> pull_request

Resulting in:

[Lint and test/build]   🐳  docker run image=act-borales-actions-yarn-v2-3-0:latest entrypoint=[] cmd=["test"]
yarn run v1.22.4
error An unexpected error occurred: "Failed to replace env in config: ${{ inputs.auth-token }".
info If you think this is a bug, please open a bug report with the information provided in "/github/workspace/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[Lint and test/build]   ❌  Failure - Run tests
<!-- gh-comment-id:667641582 --> @Sumolari commented on GitHub (Aug 2, 2020): This happened to me, too. Here's a sample workflow I'm trying to run: ```yml name: Lint and test # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the main branch on: push: branches: [main] pull_request: branches: [main] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on runs-on: ubuntu-latest steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - name: NPM or Yarn install with caching uses: bahmutov/npm-install@v1.1.0 - name: Run tests uses: Borales/actions-yarn@v2.3.0 with: cmd: test auth-token: ${{ secrets.NPM_AUTH_TOKEN }} ``` And I try to run it using: ```bash act -s NPM_AUTH_TOKEN=<MY_TOKEN_HERE> pull_request ``` Resulting in: ``` [Lint and test/build] 🐳 docker run image=act-borales-actions-yarn-v2-3-0:latest entrypoint=[] cmd=["test"] yarn run v1.22.4 error An unexpected error occurred: "Failed to replace env in config: ${{ inputs.auth-token }". info If you think this is a bug, please open a bug report with the information provided in "/github/workspace/yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. [Lint and test/build] ❌ Failure - Run tests ```
Author
Owner

@izik1 commented on GitHub (Nov 3, 2020):

Thirding this with the above error

<!-- gh-comment-id:720872582 --> @izik1 commented on GitHub (Nov 3, 2020): Thirding this with the above error
Author
Owner

@github-actions[bot] commented on GitHub (Jan 3, 2021):

Issue is stale and will be closed in 7 days unless there is new activity

<!-- gh-comment-id:753549489 --> @github-actions[bot] commented on GitHub (Jan 3, 2021): Issue is stale and will be closed in 7 days unless there is new activity
Author
Owner

@fxnoob commented on GitHub (Jan 29, 2021):

Have you guys found a solution?

<!-- gh-comment-id:769799755 --> @fxnoob commented on GitHub (Jan 29, 2021): Have you guys found a solution?
Author
Owner

@Sumolari commented on GitHub (Jan 29, 2021):

Have you guys found a solution?

I didn’t. I ended up not using this tool :(

<!-- gh-comment-id:769800531 --> @Sumolari commented on GitHub (Jan 29, 2021): > Have you guys found a solution? I didn’t. I ended up not using this tool :(
Author
Owner

@chetbox commented on GitHub (Apr 12, 2021):

I had the same problem but resolved it by switching to the Large image during act first-run.

You can do this be deleting ~/.actrc then run act again.

<!-- gh-comment-id:817661786 --> @chetbox commented on GitHub (Apr 12, 2021): I had the same problem but resolved it by switching to the `Large` image during `act` first-run. You can do this be deleting `~/.actrc` then run `act` again.
Author
Owner

@dunklesToast commented on GitHub (Apr 12, 2021):

@chetbox yarn is not installed in the "slim" version. You can easily run npm i -g yarn as a separate step if you don't want to have 18Gb of Images on your PC :D However I think this is not related to this issue.

<!-- gh-comment-id:817663975 --> @dunklesToast commented on GitHub (Apr 12, 2021): @chetbox yarn is not installed in the "slim" version. You can easily run `npm i -g yarn` as a separate step if you don't want to have 18Gb of Images on your PC :D However I think this is not related to this issue.
Author
Owner

@trainoasis commented on GitHub (Oct 19, 2021):

I had to use ubuntu:js-latest instead of default ubuntu:act-latest. Here is where I noticed that the first one includes yarn as well: https://hub.docker.com/r/catthehacker/ubuntu.

<!-- gh-comment-id:946720542 --> @trainoasis commented on GitHub (Oct 19, 2021): I had to use `ubuntu:js-latest` instead of default `ubuntu:act-latest`. Here is where I noticed that the first one includes `yarn` as well: https://hub.docker.com/r/catthehacker/ubuntu.
Author
Owner

@audishos commented on GitHub (Oct 20, 2021):

I had to use ubuntu:js-latest instead of default ubuntu:act-latest. Here is where I noticed that the first one includes yarn as well: https://hub.docker.com/r/catthehacker/ubuntu.

Thanks for this! Just want to add that this is done with the -P or --platform flag since this wasn't immediately clear to me. This flag allows you to map the runs-on value to an image. Example mapping ubuntu-latest to ubuntu:js-latest:

act pull_request -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:js-latest
<!-- gh-comment-id:948120085 --> @audishos commented on GitHub (Oct 20, 2021): > I had to use `ubuntu:js-latest` instead of default `ubuntu:act-latest`. Here is where I noticed that the first one includes `yarn` as well: https://hub.docker.com/r/catthehacker/ubuntu. Thanks for this! Just want to add that this is done with the `-P` or `--platform` flag since this wasn't immediately clear to me. This flag allows you to map the `runs-on` value to an image. Example mapping `ubuntu-latest` to `ubuntu:js-latest`: ```bash act pull_request -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:js-latest ```
Author
Owner

@uccmen commented on GitHub (Nov 25, 2021):

I had to use ubuntu:js-latest instead of default ubuntu:act-latest. Here is where I noticed that the first one includes yarn as well: https://hub.docker.com/r/catthehacker/ubuntu.

Thanks for this! Just want to add that this is done with the -P or --platform flag since this wasn't immediately clear to me. This flag allows you to map the runs-on value to an image. Example mapping ubuntu-latest to ubuntu:js-latest:

act pull_request -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:js-latest

Oddly, this didn't work for me, today. So I had to use -P ubuntu-latest=node:14 ...

<!-- gh-comment-id:978886119 --> @uccmen commented on GitHub (Nov 25, 2021): > > I had to use `ubuntu:js-latest` instead of default `ubuntu:act-latest`. Here is where I noticed that the first one includes `yarn` as well: https://hub.docker.com/r/catthehacker/ubuntu. > > Thanks for this! Just want to add that this is done with the `-P` or `--platform` flag since this wasn't immediately clear to me. This flag allows you to map the `runs-on` value to an image. Example mapping `ubuntu-latest` to `ubuntu:js-latest`: > > ```shell > act pull_request -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:js-latest > ``` Oddly, this didn't work for me, today. So I had to use `-P ubuntu-latest=node:14` ...
Author
Owner

@sbahman commented on GitHub (Oct 16, 2022):

One can replace .../catthehacker/ubuntu:act-latest with .../catthehacker/ubuntu:js-latest in the .actrc file - then one does not need to specify it everytime.

<!-- gh-comment-id:1279931380 --> @sbahman commented on GitHub (Oct 16, 2022): One can replace `.../catthehacker/ubuntu:act-latest` with `.../catthehacker/ubuntu:js-latest` in the `.actrc` file - then one does not need to specify it everytime.
Author
Owner

@mattkoch-bb commented on GitHub (Apr 11, 2023):

I had the same problem but resolved it by switching to the Large image during act first-run.

You can do this be deleting ~/.actrc then run act again.

How long does this take to download? I tried this a few times and my jobs hung.

<!-- gh-comment-id:1503772535 --> @mattkoch-bb commented on GitHub (Apr 11, 2023): > I had the same problem but resolved it by switching to the `Large` image during `act` first-run. > > You can do this be deleting `~/.actrc` then run `act` again. How long does this take to download? I tried this a few times and my jobs hung.
Author
Owner

@dunklesToast commented on GitHub (Apr 11, 2023):

How long does this take to download? I tried this a few times and my jobs hung.

The image is approx. 18GB large. Iirc act does not show the download progress but you can try pulling it via Docker manually and watch the progress there. Act should then use that image without any download steps.

<!-- gh-comment-id:1503785395 --> @dunklesToast commented on GitHub (Apr 11, 2023): > How long does this take to download? I tried this a few times and my jobs hung. The image is approx. 18GB large. Iirc act does not show the download progress but you can try pulling it via Docker manually and watch the progress there. Act should then use that image without any download steps.
Author
Owner

@catthehacker commented on GitHub (Apr 11, 2023):

You can use verbose option to see progress

<!-- gh-comment-id:1503852969 --> @catthehacker commented on GitHub (Apr 11, 2023): You can use verbose option to see progress
Author
Owner

@jlongman commented on GitHub (Oct 24, 2023):

Also, if you're on a non-linux system I recommend doing a docker pull imagename outside of act. If your VM runs out of disk space you won't see it otherwise.

<!-- gh-comment-id:1777518319 --> @jlongman commented on GitHub (Oct 24, 2023): Also, if you're on a non-linux system I recommend doing a `docker pull imagename` outside of `act`. If your VM runs out of disk space you won't see it otherwise.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#196
No description provided.