Skip to content

Commit f9bddf7

Browse files
authored
chore: update release drafter to include appropriate dependencies (#577)
Signed-off-by: Keith Zantow <kzantow@gmail.com>
1 parent ffeb136 commit f9bddf7

4 files changed

Lines changed: 56 additions & 28 deletions

File tree

.github/release-drafter.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ categories:
1010
- "fix"
1111
- "bugfix"
1212
- "bug"
13+
- title: "⬆️ Dependencies"
14+
labels:
15+
- "dependencies"
1316
change-template: "- $TITLE (#$NUMBER) [[$AUTHOR](https://github.com/$AUTHOR)]"
1417
version-resolver:
1518
major:
@@ -25,6 +28,7 @@ version-resolver:
2528

2629
exclude-labels:
2730
- 'changelog-ignore'
31+
- 'github_actions'
2832

2933
autolabeler:
3034
- label: 'changelog-ignore'

dist/index.js

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,6 +2884,18 @@ class CacheServiceClient {
28842884
}
28852885
errorMessage = `${errorMessage}: ${body.msg}`;
28862886
}
2887+
// Handle rate limiting - don't retry, just warn and exit
2888+
// For more info, see https://docs.github.com/en/actions/reference/limits
2889+
if (statusCode === http_client_1.HttpCodes.TooManyRequests) {
2890+
const retryAfterHeader = response.message.headers['retry-after'];
2891+
if (retryAfterHeader) {
2892+
const parsedSeconds = parseInt(retryAfterHeader, 10);
2893+
if (!isNaN(parsedSeconds) && parsedSeconds > 0) {
2894+
(0, core_1.warning)(`You've hit a rate limit, your rate limit will reset in ${parsedSeconds} seconds`);
2895+
}
2896+
}
2897+
throw new errors_1.RateLimitError(`Rate limited: ${errorMessage}`);
2898+
}
28872899
}
28882900
catch (error) {
28892901
if (error instanceof SyntaxError) {
@@ -2892,6 +2904,9 @@ class CacheServiceClient {
28922904
if (error instanceof errors_1.UsageError) {
28932905
throw error;
28942906
}
2907+
if (error instanceof errors_1.RateLimitError) {
2908+
throw error;
2909+
}
28952910
if (errors_1.NetworkError.isNetworkErrorCode(error === null || error === void 0 ? void 0 : error.code)) {
28962911
throw new errors_1.NetworkError(error === null || error === void 0 ? void 0 : error.code);
28972912
}
@@ -2924,8 +2939,7 @@ class CacheServiceClient {
29242939
http_client_1.HttpCodes.BadGateway,
29252940
http_client_1.HttpCodes.GatewayTimeout,
29262941
http_client_1.HttpCodes.InternalServerError,
2927-
http_client_1.HttpCodes.ServiceUnavailable,
2928-
http_client_1.HttpCodes.TooManyRequests
2942+
http_client_1.HttpCodes.ServiceUnavailable
29292943
];
29302944
return retryableStatusCodes.includes(statusCode);
29312945
}
@@ -2961,7 +2975,7 @@ function internalCacheTwirpClient(options) {
29612975
"use strict";
29622976

29632977
Object.defineProperty(exports, "__esModule", ({ value: true }));
2964-
exports.UsageError = exports.NetworkError = exports.GHESNotSupportedError = exports.CacheNotFoundError = exports.InvalidResponseError = exports.FilesNotFoundError = void 0;
2978+
exports.RateLimitError = exports.UsageError = exports.NetworkError = exports.GHESNotSupportedError = exports.CacheNotFoundError = exports.InvalidResponseError = exports.FilesNotFoundError = void 0;
29652979
class FilesNotFoundError extends Error {
29662980
constructor(files = []) {
29672981
let message = 'No files were found to upload';
@@ -3028,6 +3042,13 @@ UsageError.isUsageErrorMessage = (msg) => {
30283042
return false;
30293043
return msg.includes('insufficient usage');
30303044
};
3045+
class RateLimitError extends Error {
3046+
constructor(message) {
3047+
super(message);
3048+
this.name = 'RateLimitError';
3049+
}
3050+
}
3051+
exports.RateLimitError = RateLimitError;
30313052
//# sourceMappingURL=errors.js.map
30323053

30333054
/***/ }),
@@ -91381,7 +91402,7 @@ function randomUUID() {
9138191402
/***/ ((module) => {
9138291403

9138391404
"use strict";
91384-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"5.0.2","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^2.0.0","@actions/exec":"^2.0.0","@actions/glob":"^0.5.0","@protobuf-ts/runtime-rpc":"^2.11.1","@actions/http-client":"^3.0.1","@actions/io":"^2.0.0","@azure/abort-controller":"^1.1.0","@azure/core-rest-pipeline":"^1.22.0","@azure/storage-blob":"^12.29.1","semver":"^6.3.1"},"devDependencies":{"@types/node":"^24.1.0","@types/semver":"^6.0.0","@protobuf-ts/plugin":"^2.9.4","typescript":"^5.2.2"},"overrides":{"uri-js":"npm:uri-js-replace@^1.0.1","node-fetch":"^3.3.2"}}');
91405+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"5.0.3","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^2.0.0","@actions/exec":"^2.0.0","@actions/glob":"^0.5.0","@protobuf-ts/runtime-rpc":"^2.11.1","@actions/http-client":"^3.0.1","@actions/io":"^2.0.0","@azure/abort-controller":"^1.1.0","@azure/core-rest-pipeline":"^1.22.0","@azure/storage-blob":"^12.29.1","semver":"^6.3.1"},"devDependencies":{"@types/node":"^24.1.0","@types/semver":"^6.0.0","@protobuf-ts/plugin":"^2.9.4","typescript":"^5.2.2"},"overrides":{"uri-js":"npm:uri-js-replace@^1.0.1","node-fetch":"^3.3.2"}}');
9138591406

9138691407
/***/ })
9138791408

package-lock.json

Lines changed: 24 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"homepage": "https://github.com/anchore/anchore-scan-action#readme",
3737
"dependencies": {
38-
"@actions/cache": "^5.0.2",
38+
"@actions/cache": "^5.0.3",
3939
"@actions/core": "^2.0.2",
4040
"@actions/exec": "^2.0.0",
4141
"@actions/tool-cache": "^3.0.0",
@@ -49,8 +49,8 @@
4949
"husky": "^9.1.7",
5050
"jest": "^30.2.0",
5151
"lint-staged": "^16.2.7",
52-
"prettier": "^3.7.4",
53-
"tar": "^7.5.3",
52+
"prettier": "^3.8.0",
53+
"tar": "^7.5.6",
5454
"tslib": "^2.8.1"
5555
},
5656
"lint-staged": {

0 commit comments

Comments
 (0)