Skip to content

Commit

Permalink
fix: consider master and main on code repos
Browse files Browse the repository at this point in the history
  • Loading branch information
DaRaFF committed Nov 4, 2023
1 parent f13e453 commit 9957e38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
console.log('release-notes-patch -> v1.6.2 (switch docu repo from master to main as default branch)')
console.log('release-notes-patch -> v1.6.3 (switch docu repo from master to main as default branch + fix)')
const argv = require('yargs')
.demandOption(['token', 'owner', 'repo', 'sha', 'tag'])
.help(false)
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const branches = createBranchList({
months: {before: 8, after: 4}
})
// add 'main' to live patch the upcoming release notes
// add 'master' to live patch the upcoming release notes
branches.push('main')
branches.push('master')

const targetOwner = 'livingdocsIO'
const targetRepo = 'documentation'
Expand All @@ -39,7 +41,7 @@ module.exports = async ({token, owner, repo, sha, tag, test = false} = {}) => {

let patchedReleaseNotes
// patch release notes detail for upcoming release
if (release.branchName === 'main') {
if (release.branchName === 'master' || release.branchName === 'main') {
const pull = await getPullBySha({owner, repo, token, sha})
if (!pull) return `Release notes will not be extended, because no PR found for commit ${sha} in ${owner}/${repo}. \nThis happens when someone pushes to main without opening a PR.`
patchedReleaseNotes = addPatchToUpcomingReleaseNote({
Expand Down

0 comments on commit 9957e38

Please sign in to comment.