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

--no-ci doesn't seem to get passed through to semantic-release #81

Open
3 of 6 tasks
Twipped opened this issue Jun 21, 2022 · 6 comments
Open
3 of 6 tasks

--no-ci doesn't seem to get passed through to semantic-release #81

Twipped opened this issue Jun 21, 2022 · 6 comments
Assignees

Comments

@Twipped
Copy link

Twipped commented Jun 21, 2022

Issue type

  • bug report
  • idea
  • question
  • other

Expected behavior

Invoking MSR with --no-ci --dry-run when running in a github action should bypass the CI checks and perform a dry-run for the repo.

Actual behavior

Each package fails, complaining that it is happening in a pull request. (This error).

> multi-semantic-release --deps.bump=inherit --no-ci --dry-run
multi-semantic-release version: 6.5.1
semantic-release version: 19.0.3
flags: {
  "sequentialInit": false,
  "sequentialPrepare": true,
  "firstParent": false,
  "debug": false,
  "ignorePrivate": true,
  "ignorePackages": [],
  "tagFormat": "${name}@${version}",
  "dryRun": true,
  "deps": {
    "bump": "inherit",
    "release": "patch",
    "prefix": ""
  },
  "ci": false
}
package paths [
  '/home/runner/work/redacted/redacted/packages/__tests__/package.json',
  '/home/runner/work/redacted/redacted/packages/analytics/package.json',
  '/home/runner/work/redacted/redacted/packages/hooks/package.json',
  '/home/runner/work/redacted/redacted/packages/intercom/package.json',
  '/home/runner/work/redacted/redacted/packages/utils/package.json'
]
[3:24:46 PM] › 🎉  Started multirelease! Loading 5 packages...
[3:24:47 PM] › ✔  Loaded package @redacted/redacted-repo-tests
[3:24:47 PM] › ✔  Loaded package @redacted/package-1
[3:24:47 PM] › ✔  Loaded package @redacted/package-2
[3:24:47 PM] › ✔  Loaded package @redacted/package-3
[3:24:47 PM] › ✔  Loaded package @redacted/package-4
[3:24:47 PM] › 🎉  Queued 4 packages! Starting release...
[3:24:47 PM] [@redacted/package-1] › ℹ  Running semantic-release version 19.0.3
[3:24:47 PM] [@redacted/package-1] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
[3:24:47 PM] [@redacted/package-1] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[3:24:47 PM] [@redacted/package-1] › ✔  Loaded plugin "success" from "@semantic-release/github"
[3:24:47 PM] [@redacted/package-1] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[3:24:47 PM] [@redacted/package-1] › ℹ  This run was triggered by a pull request and therefore a new version won't be published.
[3:24:47 PM] [@redacted/package-3] › ℹ  Running semantic-release version 19.0.3
[3:24:47 PM] [@redacted/package-3] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
[3:24:47 PM] [@redacted/package-3] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[3:24:47 PM] [@redacted/package-3] › ✔  Loaded plugin "success" from "@semantic-release/github"
[3:24:47 PM] [@redacted/package-3] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[3:24:47 PM] [@redacted/package-3] › ℹ  This run was triggered by a pull request and therefore a new version won't be published.
[3:24:47 PM] [@redacted/package-4] › ℹ  Running semantic-release version 19.0.3
[3:24:47 PM] [@redacted/package-4] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
[3:24:47 PM] [@redacted/package-4] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[3:24:47 PM] [@redacted/package-4] › ✔  Loaded plugin "success" from "@semantic-release/github"
[3:24:47 PM] [@redacted/package-4] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[3:24:47 PM] [@redacted/package-4] › ℹ  This run was triggered by a pull request and therefore a new version won't be published.
[3:24:47 PM] [@redacted/package-2] › ℹ  Running semantic-release version 19.0.3
[3:24:47 PM] [@redacted/package-2] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
[3:24:47 PM] [@redacted/package-2] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[3:24:47 PM] [@redacted/package-2] › ✔  Loaded plugin "success" from "@semantic-release/github"
[3:24:47 PM] [@redacted/package-2] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[3:24:47 PM] [@redacted/package-2] › ℹ  This run was triggered by a pull request and therefore a new version won't be published.
[3:24:47 PM] › 🎉  Released 0 of 4 packages, semantically!
  • I've read the docs. This case is not mentioned (Docs do not even mention the --no-ci flag)
  • Similar issue does not exist

Steps to reproduce

Run the following in a pull request github workflow for a monorepo.
multi-semantic-release --no-ci --dry-run

Specifications

  • version: 6.5.1
  • platform: ubuntu-20.04
  • ci: github actions
@antongolub
Copy link
Member

antongolub commented Jun 21, 2022

@Twipped, thanks for highlighting this issue.

It seems related to this change: https://github.com/qiwi/multi-semantic-release/pull/80/files#diff-b9b135fc5b2b57179765a193f56284025893d03b8c6f250c75c03c2a97ad4d0dR196

Would you try to fix it?

@Twipped
Copy link
Author

Twipped commented Jun 22, 2022 via email

@Twipped
Copy link
Author

Twipped commented Jun 27, 2022

It does appear that the removal of ...flags on line 183 was the culpret. I was able to confirm that adding the following to index.js at line 205 solved the passthru:

	// - ci should use the msr version if specified, otherwise fallback to semrel
	options.ci = flags.ci === undefined ? options.ci : flags.ci;

However, once I got past that issue I ran into numerous other blockers in SR itself that made this experiment too difficult. I had been hoping to make a workflow that would output what releases a PR would trigger, but SR has so many safety checks against accidentally running on the wrong branch that I couldn't even get it to do a commit analysis. With that, I can't justify spending any more time on this.

BTW, I also noticed that branches isn't getting passed through either. I solved that by adding castArray from lodash and putting this line in as well:

	options.branches = flags.branches ? castArray(flags.branches) : options.branches;

@antongolub
Copy link
Member

antongolub commented Jul 1, 2022

@Twipped, np, thanks for the digging. We will continue this work.

@pismenskiy
Copy link

hi! I started working on this issue

@DanWebb
Copy link

DanWebb commented Nov 27, 2024

Workaround:

// package.json (top-level)
"release": {
  "noCi": true
},

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

4 participants