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

Simple Script does nothing #162

Open
oarm14 opened this issue Apr 27, 2021 · 5 comments
Open

Simple Script does nothing #162

oarm14 opened this issue Apr 27, 2021 · 5 comments

Comments

@oarm14
Copy link

oarm14 commented Apr 27, 2021

I am trying to understand how/where the scripts run. I've got a very simple shell script for testing that I want to run during any step. I've tried several.

Below is my releaserc file as well as the contents of the script. I can see where the output of semantic release shows where it runs but there is never any output from the script. No output from the echo command or version.txt is ever created. Also, notice that I do not have "./" in front of my version.sh because this runs on a windows machine and errors out when it is included. Any tips are appreciated.

releaserc

{
"branches": ["master"],
"plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/changelog",
    ["@semantic-release/exec", {
      "publishCmd": "version.sh ${nextRelease.version}"
    }],
    ["@semantic-release/git", {
      "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
    }]
  
    ]
}

Shell script
#!/bin/bash

VERSION=$1
echo "This is the version from semantic release"
echo $VERSION >> version.txt

@louis-vinchon
Copy link

louis-vinchon commented May 10, 2021

    "@semantic-release/exec": "^5.0.0",
    "@semantic-release/git": "^9.0.0",
    "semantic-release": "^17.4.2",

Same issue on linux machines, scripts do not seem to work in any way:

  • Logs are gobbled up by the package, even in debug mode from the semantic-release command.
  • Expected file output are missing.
  • Exit codes 1 in the script are completely ignored and the plugin proceeds as if nothing happened, which is most likely the case.

Tested with trivial bash and .js scripts the like of "print AAAAAA in package.json".

Nothing.

@mrjeffwagner
Copy link

mrjeffwagner commented Jun 3, 2021

I had to add bash to the script command:

"plugins": [ [ "@semantic-release/exec", { "verifyConditionsCmd": "bash ./test.sh ${nextRelease.version}" } ] ],

@jamesloosli
Copy link

I'm also having this issue. it's causing quite a bit of pain.

@dgroh
Copy link

dgroh commented Jan 27, 2022

Why no feedback on this? it's almost one year since this issue has been opened....I'm also having the same issue here

@sag1v
Copy link

sag1v commented Apr 29, 2023

Did you all try to make the bash script as an executable?

  1. Adding a shebang #!/bin/bash at the top of the file.
  2. Changing permissions: chmod +x myScript.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants