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

"Failed to replace env in config: ${NPM_TOKEN}" after release #2

filipesilva opened this issue Oct 25, 2019 · 3 comments
bug Something isn't working


Copy link

Describe the bug
Heya, if I try to use a yarn create command after the release action goes through, I get the following error:

Run yarn create cljs-app my-cljs-app
yarn create v1.19.0
error An unexpected error occurred: "Failed to replace env in config: ${NPM_TOKEN}".
info If you think this is a bug, please open a bug report with the information provided in "/home/runner/work/create-cljs-app/create-cljs-app/yarn-error.log".
info Visit for documentation about this command.
##[error]Process completed with exit code 1.

To Reproduce
Steps to reproduce the behavior:
My workflow looks like this:

    if: github.ref == 'refs/heads/master' && github.repository == 'filipesilva/create-cljs-app'
    needs: test
    runs-on: ubuntu-latest
    - uses: actions/checkout@v1
    - name: Download Artifact
      uses: actions/download-artifact@master
        name: dist  
    - name: Semantic Release
      uses: cycjimmy/semantic-release-action@v2
      id: semantic
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
    # Test the release if one was made.
    # Would be nice to group these steps on the `if` conditional, but no way to do it yet.
    - name: Use Node.js 12.x
      if: steps.semantic.outputs.new_release_published == 'true'
      uses: actions/setup-node@v1
        node-version: '12.x'
    - name: Try to use release
      if: steps.semantic.outputs.new_release_published == 'true'
      run: yarn create cljs-app my-cljs-app

I get the error in the Try to use release step. You can see an failing run in

Expected behavior
I expected no error. I suppose it happens because semantic-release-action writes to the .npmrc file? But I don't understand why the variable that I had to set as a secret doesn't work anymore.

Additional context
Add any other context about the problem here.

Copy link

cycjimmy commented Oct 26, 2019

semantic-release-action does not have extra operations on .npmrc file.

I also got this problem that occurs whether I use this action library or use the npx semantic-release command directly in Github Actions.
I recommend temporarily using the plugin of @semantic-release/exec to complete your follow-up tasks.

semantic-release configuration:

"plugins": [
  ["@semantic-release/exec", {
    "successCmd": "your code here"

workflow file:

uses: cycjimmy/semantic-release-action@v2
id: semantic
  extra_plugins: |
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

@cycjimmy cycjimmy added the bug Something isn't working label Oct 26, 2019
cycjimmy added a commit that referenced this issue Oct 26, 2019
Issue: "Failed to replace env in config: ${NPM_TOKEN}" after release #2
solution:semantic-release/semantic-release#974 (comment)
github-actions bot pushed a commit that referenced this issue Oct 26, 2019
## [2.0.1](v2.0.0...v2.0.1) (2019-10-26)

### Bug Fixes

* **.npmrc:** clean up `.npmrc` file in the repo after releasing ([a0ef86e](a0ef86e)), closes [#2](#2) [/](
Copy link

I have fixed the unexpected error (v2.0.1, v2.0.2). You don't have to change your workflow file, just re-run it to fix your problem.

Copy link

That's great, thank you!

cycjimmy pushed a commit that referenced this issue Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
bug Something isn't working
None yet

No branches or pull requests

2 participants