raulcd commented on code in PR #14731:
URL: https://github.com/apache/arrow/pull/14731#discussion_r1032566976
##########
.github/workflows/dev_pr/helpers.js:
##########
@@ -69,8 +72,44 @@ async function getJiraInfo(jiraID) {
});
}
+/**
+ * Retrieves information about a GitHub issue.
+ * @param {String} issueID
+ * @returns {Object} the information about a GitHub issue.
+ */
+ async function getGitHubInfo(github, context, issueID, pullRequestNumber) {
+ try {
+ const response = await github.issues.get({
+ issue_number: issueID,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ })
+ return response.data
+ } catch (error) {
+ console.log(`${error.name}: ${error.code}`);
+ return false
+ }
+}
+
+/**
+ * Given the title of a PullRequest checks if it contains a GitHub issue ID
+ * @param {String} title
+ * @returns {Boolean} true if title starts with a GitHub ID or MINOR:
+ */
+ function haveGitHubIssueID(title) {
+ if (!title) {
+ return false;
+ }
+ if (title.startsWith("MINOR: ")) {
+ return true;
+ }
+ return /^(WIP:?\s*)?(GH)-\d+/.test(title);
Review Comment:
I've refactored everything on `detectIssue` which returns the structure
suggested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]