Skip to content
Snippets Groups Projects
Unverified Commit 2f6e5d7f authored by Ryan Laurie's avatar Ryan Laurie Committed by GitHub
Browse files

Update Milestone Setter (#44521)

parent bdf67dbe
No related branches found
No related tags found
No related merge requests found
......@@ -29,8 +29,8 @@ jobs:
const owner = context.repo.owner;
const repo = context.repo.repo;
const branchName = '${{ github.ref }}';
const commitMessage = '${{ github.event.head_commit.message }}';
const branchName = `${{ github.ref }}`;
const commitMessage = context?.payload?.head_commit?.message ?? '';
await setMilestoneForCommits({
github,
......
......@@ -27,6 +27,7 @@
"semver": "^7.5.4",
"tsx": "^3.12.7",
"typescript": "^5.1.6",
"underscore": "^1.13.6",
"zx": "^8.1.0"
},
"devDependencies": {
......
import _ from "underscore";
import { getMilestones } from "./github";
import { getLinkedIssues, getPRsFromCommitMessage } from "./linked-issues";
import type { Issue, GithubProps, Milestone } from "./types";
......@@ -158,8 +160,11 @@ export async function setMilestoneForCommits({
console.log('Next milestone:', nextMilestone.title);
// figure out issue or PR
const PRsToCheck = commitMessages.flatMap(getPRsFromCommitMessage).filter(isNotNull);
const PRsToCheck = _.uniq(
commitMessages
.flatMap(getPRsFromCommitMessage)
.filter(isNotNull)
);
if (!PRsToCheck.length) {
throw new Error('No PRs found in commit messages');
}
......
......@@ -2818,6 +2818,11 @@ typescript@^5.1.6:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274"
integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==
underscore@^1.13.6:
version "1.13.6"
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.6.tgz#04786a1f589dc6c09f761fc5f45b89e935136441"
integrity sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==
undici-types@~5.26.4:
version "5.26.5"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment