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
Np skipping the draft release step #442
Comments
Tried adding a local .np-config.json file: {
"yarn": false,
"releaseDraft": true
} No avail. Trying to figure out how to configure np globally. (I have my global np directory open, I'll try sticking an .np-config.json file in there.) |
Sticking the .np-config.json file into Also, I'm thinking that when I first used np, the release drafts just worked. So, this probably isn't a config issue. |
Added .np-config.json to my root directory ( |
I tested changing :223-228 to make tasks.add({
title: 'Creating release draft on GitHub',
enabled: () => true, // was isOnGitHub === true,
skip: () => !options.releaseDraft,
task: () => releaseTaskHelper(options)
}); The result is:
|
In ui.js, I added a bunch of console.logs: module.exports = async (options, pkg) => {
const oldVersion = pkg.version;
const extraBaseUrls = ['gitlab.com'];
console.log()
console.log("pkg.repository")
console.log(pkg.repository)
console.log("pkg.repository end")
console.log()
console.log("githubUrlFromGit(pkg.repository.url, {extraBaseUrls})")
console.log(githubUrlFromGit(pkg.repository.url, {extraBaseUrls}))
console.log("githubUrlFromGit(pkg.repository.url, {extraBaseUrls}) end")
console.log()
const repoUrl = pkg.repository && githubUrlFromGit(pkg.repository.url, {extraBaseUrls});
... It resulted in
|
After searching the util.js, cli.js, ui.js, and index.js, I learned that it (the release portion, at least) doesn't detect the GitHub repo through the git folder. It detects it through the package.json. This means that if you This requires either an update to get the repo info from git/the git directory, or an echo/console.log to have the user update their package.json file. package.json where np did not draft a release: {
"name": "testfordraftrelease",
"version": "1.0.11",
"description": "Using this to test np",
"main": "index.js",
"scripts": {
"test": "echo 'Hi'"
},
"keywords": [],
"author": "",
"license": "ISC"
} package.json where np did draft a release: {
"name": "testfordraftrelease",
"version": "1.0.11",
"description": "Using this to test np",
"main": "index.js",
"scripts": {
"test": "echo 'Hi'"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Crowbrammer/TestRepoForNP.git"
},
"bugs": {
"url": "https://github.com/Crowbrammer/TestRepoForNP/issues"
},
"keywords": [],
"author": "",
"license": "ISC"
} |
This will make the `np` package open a draft GitHub issue after it commits. See this issue for more context on why this is needed: sindresorhus/np#442
Quick answer: Add the following to
|
np's totally skipping the draft release step, and I don't know how I made it do that.
At first, it skipped pushing the tags because it "didn't detect an upstream branch". This was weird to me because it had to push the changes somehow. Then I type
git push --set-upstream origin master
, and that handled the tag pushing. Now it pushes the tags... but it skips the release draft step. I'm not using any flags, justnp
.I do not know how to reproduce this. I've tried multiple projects; I've tried uninstalling and then reinstalling np, and the draft release step just isn't executing.
I've looked at:
and other branch pulls for ideas--no dice.
Here's what my terminal (GNU bash, version 4.4.19(1)-release (x86_64-pc-msys)) looks like.
Expected behavior
I expected the draft release step to occur whenever I use np and no errors occur.
Environment
np - 5.0.3
Node.js - 10.16.0
npm - 6.10.2
Git - 2.16.2.windows.1
OS - Windows 8.1
The text was updated successfully, but these errors were encountered: