@@ -6748,6 +6748,79 @@ exports.throttling = throttling;
6748
6748
//# sourceMappingURL=index.js.map
6749
6749
6750
6750
6751
+ /***/ }),
6752
+
6753
+ /***/ 537:
6754
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6755
+
6756
+ "use strict";
6757
+
6758
+
6759
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6760
+
6761
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6762
+
6763
+ var deprecation = __nccwpck_require__(8932);
6764
+ var once = _interopDefault(__nccwpck_require__(1223));
6765
+
6766
+ const logOnceCode = once(deprecation => console.warn(deprecation));
6767
+ const logOnceHeaders = once(deprecation => console.warn(deprecation));
6768
+ /**
6769
+ * Error with extra properties to help with debugging
6770
+ */
6771
+ class RequestError extends Error {
6772
+ constructor(message, statusCode, options) {
6773
+ super(message);
6774
+ // Maintains proper stack trace (only available on V8)
6775
+ /* istanbul ignore next */
6776
+ if (Error.captureStackTrace) {
6777
+ Error.captureStackTrace(this, this.constructor);
6778
+ }
6779
+ this.name = "HttpError";
6780
+ this.status = statusCode;
6781
+ let headers;
6782
+ if ("headers" in options && typeof options.headers !== "undefined") {
6783
+ headers = options.headers;
6784
+ }
6785
+ if ("response" in options) {
6786
+ this.response = options.response;
6787
+ headers = options.response.headers;
6788
+ }
6789
+ // redact request credentials without mutating original request options
6790
+ const requestCopy = Object.assign({}, options.request);
6791
+ if (options.request.headers.authorization) {
6792
+ requestCopy.headers = Object.assign({}, options.request.headers, {
6793
+ authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
6794
+ });
6795
+ }
6796
+ requestCopy.url = requestCopy.url
6797
+ // client_id & client_secret can be passed as URL query parameters to increase rate limit
6798
+ // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
6799
+ .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]")
6800
+ // OAuth tokens can be passed as URL query parameters, although it is not recommended
6801
+ // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
6802
+ .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
6803
+ this.request = requestCopy;
6804
+ // deprecations
6805
+ Object.defineProperty(this, "code", {
6806
+ get() {
6807
+ logOnceCode(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
6808
+ return statusCode;
6809
+ }
6810
+ });
6811
+ Object.defineProperty(this, "headers", {
6812
+ get() {
6813
+ logOnceHeaders(new deprecation.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."));
6814
+ return headers || {};
6815
+ }
6816
+ });
6817
+ }
6818
+ }
6819
+
6820
+ exports.RequestError = RequestError;
6821
+ //# sourceMappingURL=index.js.map
6822
+
6823
+
6751
6824
/***/ }),
6752
6825
6753
6826
/***/ 3682:
@@ -15536,6 +15609,7 @@ const core = __importStar(__nccwpck_require__(2186));
15536
15609
const utils_1 = __nccwpck_require__(3030);
15537
15610
const plugin_paginate_rest_1 = __nccwpck_require__(4193);
15538
15611
const plugin_throttling_1 = __nccwpck_require__(9968);
15612
+ const request_error_1 = __nccwpck_require__(537);
15539
15613
const EmptyObject_1 = __nccwpck_require__(8227);
15540
15614
const arrayDifference_1 = __importDefault(__nccwpck_require__(7034));
15541
15615
const CONST_1 = __importDefault(__nccwpck_require__(9873));
@@ -15958,6 +16032,34 @@ class GithubUtils {
15958
16032
})
15959
16033
.then((response) => response.url);
15960
16034
}
16035
+ /**
16036
+ * Get commits between two tags via the GitHub API
16037
+ */
16038
+ static async getCommitHistoryBetweenTags(fromTag, toTag) {
16039
+ console.log('Getting pull requests merged between the following tags:', fromTag, toTag);
16040
+ try {
16041
+ const { data: comparison } = await this.octokit.repos.compareCommits({
16042
+ owner: CONST_1.default.GITHUB_OWNER,
16043
+ repo: CONST_1.default.APP_REPO,
16044
+ base: fromTag,
16045
+ head: toTag,
16046
+ });
16047
+ // Map API response to our CommitType format
16048
+ return comparison.commits.map((commit) => ({
16049
+ commit: commit.sha,
16050
+ subject: commit.commit.message,
16051
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
16052
+ authorName: commit.commit.author?.name || 'Unknown',
16053
+ }));
16054
+ }
16055
+ catch (error) {
16056
+ if (error instanceof request_error_1.RequestError && error.status === 404) {
16057
+ console.error(`❓❓ Failed to compare commits with the GitHub API. The base tag ('${fromTag}') or head tag ('${toTag}') likely doesn't exist on the remote repository. If this is the case, create or push them. 💡💡`);
16058
+ }
16059
+ // Re-throw the error after logging
16060
+ throw error;
16061
+ }
16062
+ }
15961
16063
}
15962
16064
exports["default"] = GithubUtils;
15963
16065
0 commit comments