Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: semantic-release/github
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.4.3
Choose a base ref
...
head repository: semantic-release/github
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.4.4
Choose a head ref
  • 6 commits
  • 4 files changed
  • 5 contributors

Commits on Jul 30, 2019

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    7223ebf View commit details

Commits on Aug 9, 2019

  1. Copy the full SHA
    98d262a View commit details

Commits on Aug 13, 2019

  1. doc: fix a dead link in readme(#209)

    beizhedenglong authored and pvdlg committed Aug 13, 2019
    Copy the full SHA
    f862364 View commit details

Commits on Aug 22, 2019

  1. revert: doc: fix a dead link in readme(#209)

    This reverts commit f862364.
    pvdlg committed Aug 22, 2019
    Copy the full SHA
    2f3f583 View commit details

Commits on Sep 4, 2019

  1. Copy the full SHA
    a418ba0 View commit details

Commits on Sep 6, 2019

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    20ee38e View commit details
Showing with 13 additions and 15 deletions.
  1. +2 −1 .travis.yml
  2. +4 −2 lib/publish.js
  3. +1 −9 package.json
  4. +6 −3 test/publish.test.js
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
language: node_js

node_js:
- 12
- 10
- 8
- 8.3

# Trigger a push build on master and greenkeeper branches + PRs build on every branches
# Avoid double build on PRs (See https://github.com/travis-ci/travis-ci/issues/1147)
6 changes: 4 additions & 2 deletions lib/publish.js
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ module.exports = async (pluginConfig, context) => {
const draftRelease = {...releaseData, draft: true};

const {
data: {html_url: url, upload_url: uploadUrl, id: releaseId},
data: {upload_url: uploadUrl, id: releaseId},
} = await github.repos.createRelease(draftRelease);

// Append assets to the release
@@ -108,7 +108,9 @@ module.exports = async (pluginConfig, context) => {
};
/* eslint-enable */

await github.repos.updateRelease(release);
const {
data: {html_url: url},
} = await github.repos.updateRelease(release);

logger.log('Published GitHub release: %s', url);
return {url, name: 'GitHub release'};
10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -11,11 +11,6 @@
"bugs": {
"url": "https://github.com/semantic-release/github/issues"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"contributors": [
"Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
"Gregor Martynus (https://twitter.com/gr2m)"
@@ -43,9 +38,7 @@
"ava": "^2.0.0",
"clear-module": "^4.0.0",
"codecov": "^3.5.0",
"commitizen": "^3.0.0",
"cz-conventional-changelog": "^2.0.0",
"nock": "^10.0.0",
"nock": "^11.1.0",
"nyc": "^14.1.1",
"proxy": "^0.2.4",
"proxyquire": "^2.0.0",
@@ -104,7 +97,6 @@
"url": "https://github.com/semantic-release/github.git"
},
"scripts": {
"cm": "git-cz",
"codecov": "codecov -f coverage/coverage-final.json",
"lint": "xo",
"pretest": "npm run lint",
9 changes: 6 additions & 3 deletions test/publish.test.js
Original file line number Diff line number Diff line change
@@ -101,6 +101,7 @@ test.serial('Publish a release with one asset', async t => {
};
const nextRelease = {version: '1.0.0', gitHead: '123', gitTag: 'v1.0.0', notes: 'Test release note body'};
const options = {branch: 'master', repositoryUrl: `https://github.com/${owner}/${repo}.git`};
const untaggedReleaseUrl = `https://github.com/${owner}/${repo}/releases/untagged-123`;
const releaseUrl = `https://github.com/${owner}/${repo}/releases/${nextRelease.version}`;
const assetUrl = `https://github.com/${owner}/${repo}/releases/download/${nextRelease.version}/.dotfile`;
const releaseId = 1;
@@ -115,7 +116,7 @@ test.serial('Publish a release with one asset', async t => {
body: nextRelease.notes,
draft: true,
})
.reply(200, {upload_url: uploadUrl, html_url: releaseUrl, id: releaseId})
.reply(200, {upload_url: uploadUrl, html_url: untaggedReleaseUrl, id: releaseId})
.patch(`/repos/${owner}/${repo}/releases/${releaseId}`, {
draft: false,
})
@@ -146,6 +147,7 @@ test.serial('Publish a release with one asset and custom github url', async t =>
};
const nextRelease = {version: '1.0.0', gitHead: '123', gitTag: 'v1.0.0', notes: 'Test release note body'};
const options = {branch: 'master', repositoryUrl: `https://github.com/${owner}/${repo}.git`};
const untaggedReleaseUrl = `${env.GH_URL}/${owner}/${repo}/releases/untagged-123`;
const releaseUrl = `${env.GH_URL}/${owner}/${repo}/releases/${nextRelease.version}`;
const assetUrl = `${env.GH_URL}/${owner}/${repo}/releases/download/${nextRelease.version}/upload.txt`;
const releaseId = 1;
@@ -160,7 +162,7 @@ test.serial('Publish a release with one asset and custom github url', async t =>
body: nextRelease.notes,
draft: true,
})
.reply(200, {upload_url: uploadUrl, html_url: releaseUrl, id: releaseId})
.reply(200, {upload_url: uploadUrl, html_url: untaggedReleaseUrl, id: releaseId})
.patch(`/repos/${owner}/${repo}/releases/${releaseId}`, {
draft: false,
})
@@ -190,6 +192,7 @@ test.serial('Publish a release with an array of missing assets', async t => {
const pluginConfig = {assets: [emptyDirectory, {path: 'missing.txt', name: 'missing.txt'}]};
const nextRelease = {version: '1.0.0', gitHead: '123', gitTag: 'v1.0.0', notes: 'Test release note body'};
const options = {branch: 'master', repositoryUrl: `https://github.com/${owner}/${repo}.git`};
const untaggedReleaseUrl = `https://github.com/${owner}/${repo}/releases/untagged-123`;
const releaseUrl = `https://github.com/${owner}/${repo}/releases/${nextRelease.version}`;
const releaseId = 1;
const uploadUri = `/api/uploads/repos/${owner}/${repo}/releases/${releaseId}/assets`;
@@ -203,7 +206,7 @@ test.serial('Publish a release with an array of missing assets', async t => {
body: nextRelease.notes,
draft: true,
})
.reply(200, {upload_url: uploadUrl, html_url: releaseUrl, id: releaseId})
.reply(200, {upload_url: uploadUrl, html_url: untaggedReleaseUrl, id: releaseId})
.patch(`/repos/${owner}/${repo}/releases/${releaseId}`, {
draft: false,
})