Skip to content

Commit 8a670fe

Browse files
authored
chore: bump github action version sha (#7)
* chore: bump github action version sha * fix: run diff on every push * chore: try this * wip: use local action * chore: rebuild * wip: try this one * fix: remove extra logging * chore: add useful logs
1 parent e7dfc5a commit 8a670fe

File tree

4 files changed

+50
-36
lines changed

4 files changed

+50
-36
lines changed

.github/workflows/diff-dependencies.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Dependency Diff
22

33
on:
44
pull_request:
5-
types: [opened]
65

76
jobs:
87
diff_dependencies:
@@ -11,6 +10,8 @@ jobs:
1110
pull-requests: write
1211
steps:
1312
- name: Checkout repository
14-
uses: actions/checkout@v4
13+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
14+
with:
15+
fetch-depth: 0
1516
- name: Create Diff
16-
uses: e18e/action-dependency-diff@main
17+
uses: ./

main.js

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17590,12 +17590,12 @@ var require_lib = __commonJS({
1759017590
throw new Error("Client has already been disposed.");
1759117591
}
1759217592
const parsedUrl = new URL(requestUrl);
17593-
let info4 = this._prepareRequest(verb, parsedUrl, headers);
17593+
let info3 = this._prepareRequest(verb, parsedUrl, headers);
1759417594
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1;
1759517595
let numTries = 0;
1759617596
let response;
1759717597
do {
17598-
response = yield this.requestRaw(info4, data);
17598+
response = yield this.requestRaw(info3, data);
1759917599
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
1760017600
let authenticationHandler;
1760117601
for (const handler of this.handlers) {
@@ -17605,7 +17605,7 @@ var require_lib = __commonJS({
1760517605
}
1760617606
}
1760717607
if (authenticationHandler) {
17608-
return authenticationHandler.handleAuthentication(this, info4, data);
17608+
return authenticationHandler.handleAuthentication(this, info3, data);
1760917609
} else {
1761017610
return response;
1761117611
}
@@ -17628,8 +17628,8 @@ var require_lib = __commonJS({
1762817628
}
1762917629
}
1763017630
}
17631-
info4 = this._prepareRequest(verb, parsedRedirectUrl, headers);
17632-
response = yield this.requestRaw(info4, data);
17631+
info3 = this._prepareRequest(verb, parsedRedirectUrl, headers);
17632+
response = yield this.requestRaw(info3, data);
1763317633
redirectsRemaining--;
1763417634
}
1763517635
if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) {
@@ -17658,7 +17658,7 @@ var require_lib = __commonJS({
1765817658
* @param info
1765917659
* @param data
1766017660
*/
17661-
requestRaw(info4, data) {
17661+
requestRaw(info3, data) {
1766217662
return __awaiter(this, void 0, void 0, function* () {
1766317663
return new Promise((resolve, reject) => {
1766417664
function callbackForResult(err, res) {
@@ -17670,7 +17670,7 @@ var require_lib = __commonJS({
1767017670
resolve(res);
1767117671
}
1767217672
}
17673-
this.requestRawWithCallback(info4, data, callbackForResult);
17673+
this.requestRawWithCallback(info3, data, callbackForResult);
1767417674
});
1767517675
});
1767617676
}
@@ -17680,12 +17680,12 @@ var require_lib = __commonJS({
1768017680
* @param data
1768117681
* @param onResult
1768217682
*/
17683-
requestRawWithCallback(info4, data, onResult) {
17683+
requestRawWithCallback(info3, data, onResult) {
1768417684
if (typeof data === "string") {
17685-
if (!info4.options.headers) {
17686-
info4.options.headers = {};
17685+
if (!info3.options.headers) {
17686+
info3.options.headers = {};
1768717687
}
17688-
info4.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
17688+
info3.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
1768917689
}
1769017690
let callbackCalled = false;
1769117691
function handleResult(err, res) {
@@ -17694,7 +17694,7 @@ var require_lib = __commonJS({
1769417694
onResult(err, res);
1769517695
}
1769617696
}
17697-
const req = info4.httpModule.request(info4.options, (msg) => {
17697+
const req = info3.httpModule.request(info3.options, (msg) => {
1769817698
const res = new HttpClientResponse(msg);
1769917699
handleResult(void 0, res);
1770017700
});
@@ -17706,7 +17706,7 @@ var require_lib = __commonJS({
1770617706
if (socket) {
1770717707
socket.end();
1770817708
}
17709-
handleResult(new Error(`Request timeout: ${info4.options.path}`));
17709+
handleResult(new Error(`Request timeout: ${info3.options.path}`));
1771017710
});
1771117711
req.on("error", function(err) {
1771217712
handleResult(err);
@@ -17742,27 +17742,27 @@ var require_lib = __commonJS({
1774217742
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
1774317743
}
1774417744
_prepareRequest(method, requestUrl, headers) {
17745-
const info4 = {};
17746-
info4.parsedUrl = requestUrl;
17747-
const usingSsl = info4.parsedUrl.protocol === "https:";
17748-
info4.httpModule = usingSsl ? https : http;
17745+
const info3 = {};
17746+
info3.parsedUrl = requestUrl;
17747+
const usingSsl = info3.parsedUrl.protocol === "https:";
17748+
info3.httpModule = usingSsl ? https : http;
1774917749
const defaultPort = usingSsl ? 443 : 80;
17750-
info4.options = {};
17751-
info4.options.host = info4.parsedUrl.hostname;
17752-
info4.options.port = info4.parsedUrl.port ? parseInt(info4.parsedUrl.port) : defaultPort;
17753-
info4.options.path = (info4.parsedUrl.pathname || "") + (info4.parsedUrl.search || "");
17754-
info4.options.method = method;
17755-
info4.options.headers = this._mergeHeaders(headers);
17750+
info3.options = {};
17751+
info3.options.host = info3.parsedUrl.hostname;
17752+
info3.options.port = info3.parsedUrl.port ? parseInt(info3.parsedUrl.port) : defaultPort;
17753+
info3.options.path = (info3.parsedUrl.pathname || "") + (info3.parsedUrl.search || "");
17754+
info3.options.method = method;
17755+
info3.options.headers = this._mergeHeaders(headers);
1775617756
if (this.userAgent != null) {
17757-
info4.options.headers["user-agent"] = this.userAgent;
17757+
info3.options.headers["user-agent"] = this.userAgent;
1775817758
}
17759-
info4.options.agent = this._getAgent(info4.parsedUrl);
17759+
info3.options.agent = this._getAgent(info3.parsedUrl);
1776017760
if (this.handlers) {
1776117761
for (const handler of this.handlers) {
17762-
handler.prepareRequest(info4.options);
17762+
handler.prepareRequest(info3.options);
1776317763
}
1776417764
}
17765-
return info4;
17765+
return info3;
1776617766
}
1776717767
_mergeHeaders(headers) {
1776817768
if (this.requestOptions && this.requestOptions.headers) {
@@ -19752,10 +19752,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
1975219752
(0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
1975319753
}
1975419754
exports.notice = notice;
19755-
function info4(message) {
19755+
function info3(message) {
1975619756
process.stdout.write(message + os.EOL);
1975719757
}
19758-
exports.info = info4;
19758+
exports.info = info3;
1975919759
function startGroup(name) {
1976019760
(0, command_1.issue)("group", name);
1976119761
}
@@ -24139,8 +24139,7 @@ function getFileFromRef(ref, filePath, cwd2) {
2413924139
stdio: "pipe"
2414024140
});
2414124141
return content;
24142-
} catch (err) {
24143-
core.info(`Could not get ${filePath} from ${ref}: ${err}`);
24142+
} catch {
2414424143
return null;
2414524144
}
2414624145
}
@@ -24228,6 +24227,8 @@ async function run() {
2422824227
core3.getInput("size-threshold") || "100000",
2422924228
10
2423024229
);
24230+
core3.info(`Dependency threshold set to ${dependencyThreshold}`);
24231+
core3.info(`Size threshold set to ${formatBytes(sizeThreshold)}`);
2423124232
const messages = [];
2423224233
const currentDepCount = Array.from(currentDeps.values()).reduce(
2423324234
(sum, versions) => sum + versions.size,
@@ -24238,6 +24239,9 @@ async function run() {
2423824239
0
2423924240
);
2424024241
const depIncrease = currentDepCount - baseDepCount;
24242+
core3.info(`Base dependency count: ${baseDepCount}`);
24243+
core3.info(`Current dependency count: ${currentDepCount}`);
24244+
core3.info(`Dependency count increase: ${depIncrease}`);
2424124245
if (depIncrease >= dependencyThreshold) {
2424224246
messages.push(
2424324247
`\u26A0\uFE0F **Dependency Count Warning**: This PR adds ${depIncrease} new dependencies (${baseDepCount} \u2192 ${currentDepCount}), which exceeds the threshold of ${dependencyThreshold}.`
@@ -24256,6 +24260,7 @@ async function run() {
2425624260
}
2425724261
}
2425824262
}
24263+
core3.info(`Found ${newVersions.length} new package versions`);
2425924264
if (newVersions.length > 0) {
2426024265
const sizeWarnings = [];
2426124266
for (const dep of newVersions) {

src/git.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ export function getFileFromRef(
1414
stdio: 'pipe'
1515
});
1616
return content;
17-
} catch (err) {
18-
core.info(`Could not get ${filePath} from ${ref}: ${err}`);
17+
} catch {
1918
return null;
2019
}
2120
}

src/main.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ async function run(): Promise<void> {
6969
10
7070
);
7171

72+
core.info(`Dependency threshold set to ${dependencyThreshold}`);
73+
core.info(`Size threshold set to ${formatBytes(sizeThreshold)}`);
74+
7275
const messages: string[] = [];
7376

7477
// Count total dependencies (all package-version combinations)
@@ -82,6 +85,10 @@ async function run(): Promise<void> {
8285
);
8386
const depIncrease = currentDepCount - baseDepCount;
8487

88+
core.info(`Base dependency count: ${baseDepCount}`);
89+
core.info(`Current dependency count: ${currentDepCount}`);
90+
core.info(`Dependency count increase: ${depIncrease}`);
91+
8592
if (depIncrease >= dependencyThreshold) {
8693
messages.push(
8794
`⚠️ **Dependency Count Warning**: This PR adds ${depIncrease} new dependencies (${baseDepCount}${currentDepCount}), which exceeds the threshold of ${dependencyThreshold}.`
@@ -108,6 +115,8 @@ async function run(): Promise<void> {
108115
}
109116
}
110117

118+
core.info(`Found ${newVersions.length} new package versions`);
119+
111120
if (newVersions.length > 0) {
112121
const sizeWarnings: string[] = [];
113122

0 commit comments

Comments
 (0)