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

chore: update changlelog script to handle revert pr ref #26801

Merged
merged 8 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions scripts/semantic-commits/get-binary-release-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@ const getReleaseData = async (latestReleaseInfo) => {

const { type: semanticType, references } = semanticResult

if (!references.length || !references[0].issue) {
if (!references.length) {
console.log('Commit does not have an associated pull request number...')

return
}

const ref = references.find((r) => !r.raw.includes('revert #'))

if (!ref) {
console.log('Commit does not have an associated pull request number...')

return
Expand All @@ -75,19 +83,19 @@ const getReleaseData = async (latestReleaseInfo) => {
const { data: pullRequest } = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', {
owner: 'cypress-io',
repo: 'cypress',
pull_number: references[0].issue,
pull_number: ref.issue,
})

const associatedIssues = getLinkedIssues(pullRequest.body)

commits.push({
commitMessage: semanticResult.header,
semanticType,
prNumber: references[0].issue,
prNumber: ref.issue,
associatedIssues,
})

prsInRelease.push(`https://github.com/cypress-io/cypress/pull/${references[0].issue}`)
prsInRelease.push(`https://github.com/cypress-io/cypress/pull/${ref.issue}`)

associatedIssues.forEach((issueNumber) => {
issuesInRelease.push(`https://github.com/cypress-io/cypress/issues/${issueNumber}`)
Expand Down
2 changes: 1 addition & 1 deletion scripts/semantic-commits/validate-binary-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const changelog = async () => {
if (process.env.CIRCLECI) {
console.log({ checkedInBinaryVersion })

if (process.env.CIRCLE_BRANCH !== 'develop' && process.env.CIRCLE_BRANCH !== 'release-12.5.0' && !/^release\/\d+\.\d+\.\d+$/.test(process.env.CIRCLE_BRANCH) && !hasVersionBump) {
if (process.env.CIRCLE_BRANCH !== 'develop' && process.env.CIRCLE_BRANCH !== 'fix-changelog-script' && !/^release\/\d+\.\d+\.\d+$/.test(process.env.CIRCLE_BRANCH) && !hasVersionBump) {
console.log('Only verify the entire changelog for develop, a release branch or any branch that bumped to the Cypress version in the package.json.')

return
Expand Down