Skip to main content

github.github.matchallcommits

Home > @runlightyear/github > GitHub > matchAllCommits

GitHub.matchAllCommits() method

Match all commits

Signature:
static matchAllCommits(props: MatchAllCommitsProps): string[];

Parameters

ParameterTypeDescription
propsMatchAllCommitsProps
Returns:

string[]

Example

Match Linear identifiers in an array of commits

const response = await github.compareTwoCommits({
owner: "<owner>",
repo: "<repo>",
basehead: `${prevCommitId}...${newCommitId}`,
});

const { commits } = response.data;

const matches = GitHub.matchAllCommits({ regex: /ENG-[0-9]+/, commits });