release-please
Advanced tools
Comparing version 5.3.0 to 5.4.0
@@ -47,2 +47,6 @@ #!/usr/bin/env node | ||
default: false, | ||
}) | ||
.option('default-branch', { | ||
describe: 'default branch to open release PR against', | ||
type: 'string', | ||
}); | ||
@@ -115,2 +119,6 @@ }, (argv) => { | ||
}) | ||
.option('default-branch', { | ||
describe: '', | ||
type: 'string', | ||
}) | ||
.demandCommand(1) | ||
@@ -117,0 +125,0 @@ .strict(true) |
@@ -15,2 +15,3 @@ import { Octokit } from '@octokit/rest'; | ||
interface GitHubOptions { | ||
defaultBranch?: string; | ||
token?: string; | ||
@@ -48,2 +49,3 @@ owner: string; | ||
export declare class GitHub { | ||
defaultBranch?: string; | ||
octokit: OctokitType; | ||
@@ -73,2 +75,3 @@ request: Function; | ||
openPR(options: GitHubPR): Promise<number>; | ||
private getDefaultBranch; | ||
updateFiles(updates: Update[], branch: string, refName: string): Promise<void>; | ||
@@ -75,0 +78,0 @@ private refByBranchName; |
@@ -28,2 +28,3 @@ "use strict"; | ||
constructor(options) { | ||
this.defaultBranch = options.defaultBranch; | ||
this.token = options.token; | ||
@@ -473,2 +474,3 @@ this.owner = options.owner; | ||
await this.updateFiles(options.updates, options.branch, refName); | ||
const base = await this.getDefaultBranch(this.owner, this.repo); | ||
if (openReleasePR) { | ||
@@ -486,3 +488,3 @@ // TODO: dig into why `updateRef` closes an issue attached | ||
state: 'open', | ||
base: 'master', | ||
base, | ||
}); | ||
@@ -499,3 +501,3 @@ return openReleasePR.number; | ||
head: options.branch, | ||
base: 'master', | ||
base, | ||
}); | ||
@@ -505,2 +507,13 @@ return resp.data.number; | ||
} | ||
async getDefaultBranch(owner, repo) { | ||
if (this.defaultBranch) { | ||
return this.defaultBranch; | ||
} | ||
const { data } = await this.octokit.repos.get({ | ||
repo, | ||
owner, | ||
}); | ||
this.defaultBranch = data.default_branch; | ||
return this.defaultBranch; | ||
} | ||
async updateFiles(updates, branch, refName) { | ||
@@ -507,0 +520,0 @@ // does the user care about skipping CI at all? |
@@ -33,4 +33,2 @@ "use strict"; | ||
const commit = await graphqlToCommit(github, commitEdge, observedSHAs); | ||
// if the commit and its associated PR do not share a sha, we assume | ||
// that the commit was a push to master and disregard it. | ||
if (commit) { | ||
@@ -58,3 +56,3 @@ commits.commits.push(commit); | ||
// if the commit.sha and mergeCommit.oid do not match, assume that this | ||
// was a push to master and drop the commit. | ||
// was a push directly to the default branch. | ||
// | ||
@@ -61,0 +59,0 @@ // TODO: investigate our motivations for skipping commits when |
@@ -7,2 +7,3 @@ import { ConventionalCommits } from './conventional-commits'; | ||
bumpMinorPreMajor?: boolean; | ||
defaultBranch?: string; | ||
label?: string; | ||
@@ -29,2 +30,3 @@ token?: string; | ||
apiUrl: string; | ||
defaultBranch?: string; | ||
labels: string[]; | ||
@@ -31,0 +33,0 @@ gh: GitHub; |
@@ -26,2 +26,3 @@ "use strict"; | ||
this.bumpMinorPreMajor = options.bumpMinorPreMajor || false; | ||
this.defaultBranch = options.defaultBranch; | ||
this.labels = options.label | ||
@@ -126,2 +127,3 @@ ? options.label.split(',') | ||
token: this.token, | ||
defaultBranch: this.defaultBranch, | ||
owner, | ||
@@ -128,0 +130,0 @@ repo, |
@@ -67,2 +67,8 @@ "use strict"; | ||
})); | ||
updates.push(new package_json_1.PackageJson({ | ||
path: 'package-lock.json', | ||
changelogEntry, | ||
version: candidate.version, | ||
packageName: this.packageName, | ||
})); | ||
updates.push(new samples_package_json_1.SamplesPackageJson({ | ||
@@ -69,0 +75,0 @@ path: 'samples/package.json', |
@@ -25,2 +25,12 @@ "use strict"; | ||
const setup_cfg_1 = require("../updaters/python/setup-cfg"); | ||
const CHANGELOG_SECTIONS = [ | ||
{ type: 'feat', section: 'Features' }, | ||
{ type: 'fix', section: 'Bug Fixes' }, | ||
{ type: 'docs', section: 'Documentation' }, | ||
{ type: 'chore', section: 'Miscellaneous Chores', hidden: true }, | ||
{ type: 'refactor', section: 'Code Refactoring', hidden: true }, | ||
{ type: 'test', section: 'Tests', hidden: true }, | ||
{ type: 'build', section: 'Build System', hidden: true }, | ||
{ type: 'ci', section: 'Continuous Integration', hidden: true }, | ||
]; | ||
class Python extends release_pr_1.ReleasePR { | ||
@@ -34,2 +44,3 @@ async _run() { | ||
bumpMinorPreMajor: this.bumpMinorPreMajor, | ||
changelogSections: CHANGELOG_SECTIONS, | ||
}); | ||
@@ -36,0 +47,0 @@ const candidate = await this.coerceReleaseCandidate(cc, latestTag); |
@@ -7,2 +7,16 @@ # Changelog | ||
## [5.4.0](https://www.github.com/googleapis/release-please/compare/v5.3.0...v5.4.0) (2020-06-17) | ||
### Features | ||
* detect default branch ([#468](https://www.github.com/googleapis/release-please/issues/468)) ([301a08a](https://www.github.com/googleapis/release-please/commit/301a08a1afdac48fd81b55816316f14d42aba23c)) | ||
* **node:** update version number in package-lock.json ([#467](https://www.github.com/googleapis/release-please/issues/467)) ([2d69956](https://www.github.com/googleapis/release-please/commit/2d69956bb80619097f92c6d5eb809f8083381acb)) | ||
### Bug Fixes | ||
* list commits of type `docs` for python ([#460](https://www.github.com/googleapis/release-please/issues/460)) ([ba06649](https://www.github.com/googleapis/release-please/commit/ba06649fc17843d3dcff16bef5cdf0f33f0d5fc4)), closes [#459](https://www.github.com/googleapis/release-please/issues/459) | ||
* **deps:** update dependency @octokit/rest to v18 ([#465](https://www.github.com/googleapis/release-please/issues/465)) ([ffbf2eb](https://www.github.com/googleapis/release-please/commit/ffbf2eb1109897fb0d7d98a9056fb8052a5cc4f9)) | ||
## [5.3.0](https://www.github.com/googleapis/release-please/compare/v5.2.1...v5.3.0) (2020-06-11) | ||
@@ -9,0 +23,0 @@ |
{ | ||
"name": "release-please", | ||
"version": "5.3.0", | ||
"version": "5.4.0", | ||
"description": "generate release PRs based on the conventionalcommits.org spec", | ||
@@ -38,3 +38,3 @@ "main": "./build/src/index.js", | ||
"devDependencies": { | ||
"@octokit/types": "^4.0.0", | ||
"@octokit/types": "^5.0.0", | ||
"@types/chai": "^4.1.7", | ||
@@ -49,3 +49,3 @@ "@types/mocha": "^7.0.0", | ||
"gts": "^2.0.0", | ||
"mocha": "^7.0.0", | ||
"mocha": "^8.0.0", | ||
"nock": "^12.0.0", | ||
@@ -58,3 +58,3 @@ "snap-shot-it": "^7.0.0", | ||
"@octokit/request": "^5.3.4", | ||
"@octokit/rest": "^17.1.4", | ||
"@octokit/rest": "^18.0.0", | ||
"chalk": "^4.0.0", | ||
@@ -61,0 +61,0 @@ "concat-stream": "^2.0.0", |
@@ -112,2 +112,3 @@ <img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/> | ||
| `--token` | a token with write access to `--repo-url`. | | ||
| `--default-branch`| branch to open pull release PR against (detected by default). | | ||
@@ -114,0 +115,0 @@ ### Creating a release on GitHub |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
225100
4165
174
+ Added@octokit/core@3.6.0(transitive)
+ Added@octokit/plugin-rest-endpoint-methods@5.16.2(transitive)
+ Added@octokit/rest@18.12.0(transitive)
- Removed@octokit/auth-token@5.1.1(transitive)
- Removed@octokit/core@2.5.46.1.2(transitive)
- Removed@octokit/endpoint@10.1.1(transitive)
- Removed@octokit/graphql@8.1.1(transitive)
- Removed@octokit/openapi-types@22.2.0(transitive)
- Removed@octokit/plugin-rest-endpoint-methods@3.17.0(transitive)
- Removed@octokit/request@9.1.3(transitive)
- Removed@octokit/request-error@6.1.5(transitive)
- Removed@octokit/rest@17.11.2(transitive)
- Removed@octokit/types@13.6.24.1.105.5.0(transitive)
- Removed@types/node@22.10.2(transitive)
- Removedbefore-after-hook@3.0.2(transitive)
- Removedcross-spawn@6.0.6(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedexeca@1.0.0(transitive)
- Removedget-stream@4.1.0(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedmacos-release@2.5.1(transitive)
- Removednice-try@1.0.5(transitive)
- Removednpm-run-path@2.0.2(transitive)
- Removedos-name@3.1.0(transitive)
- Removedp-finally@1.0.0(transitive)
- Removedpath-key@2.0.1(transitive)
- Removedpump@3.0.2(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstrip-eof@1.0.0(transitive)
- Removedundici-types@6.20.0(transitive)
- Removeduniversal-user-agent@5.0.07.0.2(transitive)
- Removedwhich@1.3.1(transitive)
- Removedwindows-release@3.3.3(transitive)
Updated@octokit/rest@^18.0.0