PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, August 22, 2022

[FIXED] How can I use environmental variables in the .releaserc.json?

 August 22, 2022     configuration, environment-variables, semantic-release     No comments   

Issue

I want to do something like this,

["@semantic-release/exec", {
  "prepareCmd": "echo hello ${HOME};"
}],

And then run this CI job with an environmental variable? Is there a method of making this work in semantic-release?


Solution

Use .releaserc.js, or release.config.js

You can rename the releaserc.json to release.config.js or .releaserc.js`, and then it's just a CommonJS module,

const greets = "HELLO ";

module.exports = {
    "foo": `${greets} ${process.title}`
}

That will run as expected.

Internally semantic-release uses cosmiconfig



Answered By - Evan Carroll
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing