Skip to content

open-pr: try harder to find a corresponding component-update ticket #9

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

Merged
merged 1 commit into from
Jan 2, 2023
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/open-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ jobs:
let body = ''
try {
const name = process.env.PACKAGE_TO_UPGRADE
const version = `${name.match(/git-lfs/) ? 'v' : ''}${process.env.UPGRADE_TO_VERSION}`
const version = process.env.UPGRADE_TO_VERSION

if (name === 'mintty') body = `See https://github.com/mintty/mintty/releases/tag/${version} for details.`
else if (name === 'mingw-w64-git-lfs') body = `See https://github.com/git-lfs/git-lfs/releases/tag/${version} for details.`
else if (name === 'mingw-w64-pcre2') body = `See https://github.com/PCRE2Project/pcre2/blob/pcre2-${version}/ChangeLog for details.`

const terms = 'type:issue repo:git-for-windows/git state:open author:app/github-actions label:component-update'
const { data } = await github.rest.search.issuesAndPullRequests({
q: `"[New ${name.replace(/^mingw-w64-/, '')} version]" ${version} in:title ${terms}`,
q: `"[New ${name.replace(/^mingw-w64-/, '')} version]" (${version} OR v${version}) in:title ${terms}`,
})
if (data.total_count) body = `${body ? `${body}\n\n` : ''}This closes ${data.items[0].html_url}`
} catch (e) {
Expand Down