mirror of
https://github.com/joaquinjsb/gitea-release-please-action
synced 2026-05-05 10:37:47 +02:00
committed by
GitHub
parent
748eaa1a57
commit
2023ce4d12
94
dist/index.js
vendored
94
dist/index.js
vendored
@@ -80625,64 +80625,72 @@ class GitHub {
|
||||
}
|
||||
}
|
||||
async mergeCommitsGraphQL(targetBranch, cursor, options = {}) {
|
||||
var _a;
|
||||
var _a, _b;
|
||||
logger_1.logger.debug(`Fetching merge commits on branch ${targetBranch} with cursor: ${cursor}`);
|
||||
const response = await this.graphqlRequest({
|
||||
query: `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $cursor: String) {
|
||||
repository(owner: $owner, name: $repo) {
|
||||
ref(qualifiedName: $targetBranch) {
|
||||
target {
|
||||
... on Commit {
|
||||
history(first: $num, after: $cursor) {
|
||||
nodes {
|
||||
associatedPullRequests(first: 10) {
|
||||
nodes {
|
||||
number
|
||||
title
|
||||
baseRefName
|
||||
headRefName
|
||||
labels(first: 10) {
|
||||
nodes {
|
||||
name
|
||||
}
|
||||
const query = `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $cursor: String) {
|
||||
repository(owner: $owner, name: $repo) {
|
||||
ref(qualifiedName: $targetBranch) {
|
||||
target {
|
||||
... on Commit {
|
||||
history(first: $num, after: $cursor) {
|
||||
nodes {
|
||||
associatedPullRequests(first: 10) {
|
||||
nodes {
|
||||
number
|
||||
title
|
||||
baseRefName
|
||||
headRefName
|
||||
labels(first: 10) {
|
||||
nodes {
|
||||
name
|
||||
}
|
||||
body
|
||||
mergeCommit {
|
||||
oid
|
||||
}
|
||||
body
|
||||
mergeCommit {
|
||||
oid
|
||||
}
|
||||
files(first: $maxFilesChanged) {
|
||||
nodes {
|
||||
path
|
||||
}
|
||||
files(first: $maxFilesChanged) {
|
||||
nodes {
|
||||
path
|
||||
}
|
||||
pageInfo {
|
||||
endCursor
|
||||
hasNextPage
|
||||
}
|
||||
pageInfo {
|
||||
endCursor
|
||||
hasNextPage
|
||||
}
|
||||
}
|
||||
}
|
||||
sha: oid
|
||||
message
|
||||
}
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
endCursor
|
||||
}
|
||||
sha: oid
|
||||
message
|
||||
}
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
endCursor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`,
|
||||
}
|
||||
}`;
|
||||
const params = {
|
||||
cursor,
|
||||
owner: this.repository.owner,
|
||||
repo: this.repository.repo,
|
||||
num: 25,
|
||||
targetBranch,
|
||||
maxFilesChanged: 100, // max is 100
|
||||
};
|
||||
const response = await this.graphqlRequest({
|
||||
query,
|
||||
...params,
|
||||
});
|
||||
if (!response) {
|
||||
logger_1.logger.warn(`Did not receive a response for query: ${query}`, params);
|
||||
return null;
|
||||
}
|
||||
// if the branch does exist, return null
|
||||
if (!response.repository.ref) {
|
||||
if (!((_a = response.repository) === null || _a === void 0 ? void 0 : _a.ref)) {
|
||||
logger_1.logger.warn(`Could not find commits for branch ${targetBranch} - it likely does not exist.`);
|
||||
return null;
|
||||
}
|
||||
@@ -80709,7 +80717,7 @@ class GitHub {
|
||||
labels: pullRequest.labels.nodes.map(node => node.name),
|
||||
files,
|
||||
};
|
||||
if (((_a = pullRequest.files.pageInfo) === null || _a === void 0 ? void 0 : _a.hasNextPage) && options.backfillFiles) {
|
||||
if (((_b = pullRequest.files.pageInfo) === null || _b === void 0 ? void 0 : _b.hasNextPage) && options.backfillFiles) {
|
||||
logger_1.logger.info(`PR #${pullRequest.number} has many files, backfilling`);
|
||||
commit.files = await this.getCommitFiles(graphCommit.sha);
|
||||
}
|
||||
@@ -88683,12 +88691,14 @@ class BranchFileCache {
|
||||
* @returns {TreeEntry[]} The tree entries
|
||||
*/
|
||||
async fetchTree(sha) {
|
||||
const { data: { tree }, } = await this.octokit.git.getTree({
|
||||
const { data: { tree, truncated }, } = await this.octokit.git.getTree({
|
||||
owner: this.repository.owner,
|
||||
repo: this.repository.repo,
|
||||
tree_sha: sha,
|
||||
recursive: 'false',
|
||||
});
|
||||
if (truncated) {
|
||||
logger_1.logger.warn(`file list for tree sha ${sha} is truncated`);
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
/**
|
||||
@@ -114285,7 +114295,7 @@ module.exports = {};
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = {"i8":"13.18.7"};
|
||||
module.exports = {"i8":"13.19.3"};
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user