mirror of
https://github.com/actions/stale.git
synced 2026-01-03 13:58:18 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a21a081629 | ||
|
|
997185467f | ||
|
|
5611b9defa | ||
|
|
fad0de84e5 | ||
|
|
39bea7de61 | ||
|
|
e46bbabb3e | ||
|
|
65d1d4804d |
2
.github/workflows/e2e-tests.yml
vendored
2
.github/workflows/e2e-tests.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
dry-run-test: # make sure the action works on a clean machine without building
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: ./
|
||||
id: stale
|
||||
with:
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checking out
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
- name: Publish
|
||||
id: publish
|
||||
uses: actions/publish-immutable-action@v0.0.4
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Update the ${{ env.TAG_NAME }} tag
|
||||
uses: actions/publish-action@v0.3.0
|
||||
uses: actions/publish-action@v0.4.0
|
||||
with:
|
||||
source-tag: ${{ env.TAG_NAME }}
|
||||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||
|
||||
2
.licenses/npm/@types/node.dep.yml
generated
2
.licenses/npm/@types/node.dep.yml
generated
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@types/node"
|
||||
version: 24.1.0
|
||||
version: 24.3.1
|
||||
type: npm
|
||||
summary: TypeScript definitions for node
|
||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
|
||||
|
||||
2
.licenses/npm/undici-types.dep.yml
generated
2
.licenses/npm/undici-types.dep.yml
generated
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: undici-types
|
||||
version: 7.8.0
|
||||
version: 7.10.0
|
||||
type: npm
|
||||
summary: A stand-alone types package for Undici
|
||||
homepage: https://undici.nodejs.org
|
||||
|
||||
30
CHANGELOG.md
30
CHANGELOG.md
@@ -1,5 +1,35 @@
|
||||
# Changelog
|
||||
|
||||
# [10.1.0]
|
||||
|
||||
## What's Changed
|
||||
|
||||
* Add only-issue-types option to filter issues by type by @Bibo-Joshi in https://github.com/actions/stale/pull/1255
|
||||
|
||||
# [10.0.0]
|
||||
|
||||
## What's Changed
|
||||
|
||||
## Breaking Changes
|
||||
* Upgrade to node 24 by @salmanmkc in https://github.com/actions/stale/pull/1279
|
||||
Make sure your runner is on version v2.327.1 or later to ensure compatibility with this release. [Release Notes](https://github.com/actions/runner/releases/tag/v2.327.1)
|
||||
|
||||
## Enhancement
|
||||
- Introducing sort-by option by @suyashgaonkar in https://github.com/actions/stale/pull/1254
|
||||
|
||||
## Dependency Upgrades
|
||||
* Upgrade actions/publish-immutable-action from 0.0.3 to 0.0.4 by @dependabot[bot] in https://github.com/actions/stale/pull/1186
|
||||
* Upgrade undici from 5.28.4 to 5.28.5 by @dependabot[bot] in https://github.com/actions/stale/pull/1201
|
||||
* Upgrade @action/cache from 4.0.0 to 4.0.2 by @aparnajyothi-y in https://github.com/actions/stale/pull/1226
|
||||
* Upgrade @action/cache from 4.0.2 to 4.0.3 by @suyashgaonkar in https://github.com/actions/stale/pull/1233
|
||||
* Upgrade undici from 5.28.5 to 5.29.0 by @dependabot[bot] in https://github.com/actions/stale/pull/1251
|
||||
* Upgrade form-data to bring in fix for critical vulnerability by @gowridurgad in https://github.com/actions/stale/pull/1277
|
||||
|
||||
## Documentation changes
|
||||
|
||||
- Changelog update for recent releases by @suyashgaonkar in https://github.com/actions/stale/pull/1224
|
||||
- Permissions update in Readme by @ghadimir in https://github.com/actions/stale/pull/1248
|
||||
|
||||
# [9.1.0]
|
||||
|
||||
## What's Changed
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
[](https://github.com/actions/stale/actions/workflows/basic-validation.yml)
|
||||
[](https://github.com/actions/stale/actions/workflows/e2e-tests.yml)
|
||||
|
||||
## Breaking changes in V10
|
||||
|
||||
- Upgraded action from node20 to node 24
|
||||
> Make sure your runner is on version v2.327.1 or later to ensure compatibility with this release. [Release Notes](https://github.com/actions/runner/releases/tag/v2.327.1)
|
||||
|
||||
For more details, see the full release notes on the [release page](https://github.com/actions/stale/releases/tag/v10.0.0)
|
||||
|
||||
Warns and then closes issues and PRs that have had no activity for a specified amount of time.
|
||||
|
||||
The configuration must be on the default branch and the default values will:
|
||||
|
||||
29
dist/index.js
vendored
29
dist/index.js
vendored
@@ -761,6 +761,7 @@ class IssuesProcessor {
|
||||
});
|
||||
}
|
||||
getRateLimit() {
|
||||
var _a;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const logger = new logger_1.Logger();
|
||||
try {
|
||||
@@ -768,7 +769,13 @@ class IssuesProcessor {
|
||||
return new rate_limit_1.RateLimit(rateLimitResult.data.rate);
|
||||
}
|
||||
catch (error) {
|
||||
logger.error(`Error when getting rateLimit: ${error.message}`);
|
||||
const status = error === null || error === void 0 ? void 0 : error.status;
|
||||
const message = (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : String(error);
|
||||
if (status === 404 && message.includes('Rate limiting is not enabled')) {
|
||||
logger.warning('Rate limiting is not enabled on this instance. Proceeding without rate limit checks.');
|
||||
return undefined;
|
||||
}
|
||||
logger.error(`Error when getting rateLimit: ${message}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1639,9 +1646,13 @@ const getOctokitClient = () => {
|
||||
const checkIfCacheExists = (cacheKey) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const client = getOctokitClient();
|
||||
try {
|
||||
const issueResult = yield client.request(`/repos/${github_1.context.repo.owner}/${github_1.context.repo.repo}/actions/caches`);
|
||||
const caches = issueResult.data['actions_caches'] || [];
|
||||
return Boolean(caches.find(cache => cache['key'] === cacheKey));
|
||||
const cachesResult = yield client.rest.actions.getActionsCacheList({
|
||||
owner: github_1.context.repo.owner,
|
||||
repo: github_1.context.repo.repo,
|
||||
key: cacheKey // prefix matching
|
||||
});
|
||||
const caches = cachesResult.data['actions_caches'] || [];
|
||||
return caches.some(cache => cache['key'] === cacheKey);
|
||||
}
|
||||
catch (error) {
|
||||
core.debug(`Error checking if cache exist: ${error.message}`);
|
||||
@@ -1652,8 +1663,11 @@ const resetCacheWithOctokit = (cacheKey) => __awaiter(void 0, void 0, void 0, fu
|
||||
const client = getOctokitClient();
|
||||
core.debug(`remove cache "${cacheKey}"`);
|
||||
try {
|
||||
// TODO: replace with client.rest.
|
||||
yield client.request(`DELETE /repos/${github_1.context.repo.owner}/${github_1.context.repo.repo}/actions/caches?key=${cacheKey}`);
|
||||
yield client.rest.actions.deleteActionsCacheByKey({
|
||||
owner: github_1.context.repo.owner,
|
||||
repo: github_1.context.repo.repo,
|
||||
key: cacheKey
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
if (error.status) {
|
||||
@@ -2610,7 +2624,8 @@ function _getAndValidateArgs() {
|
||||
ignorePrUpdates: _toOptionalBoolean('ignore-pr-updates'),
|
||||
exemptDraftPr: core.getInput('exempt-draft-pr') === 'true',
|
||||
closeIssueReason: core.getInput('close-issue-reason'),
|
||||
includeOnlyAssigned: core.getInput('include-only-assigned') === 'true'
|
||||
includeOnlyAssigned: core.getInput('include-only-assigned') === 'true',
|
||||
onlyIssueTypes: core.getInput('only-issue-types')
|
||||
};
|
||||
for (const numberInput of ['days-before-stale']) {
|
||||
if (isNaN(parseFloat(core.getInput(numberInput)))) {
|
||||
|
||||
28
package-lock.json
generated
28
package-lock.json
generated
@@ -20,14 +20,14 @@
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/lodash.deburr": "^4.1.6",
|
||||
"@types/node": "^24.1.0",
|
||||
"@types/node": "^24.3.1",
|
||||
"@types/semver": "^7.5.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
||||
"@typescript-eslint/parser": "^6.2.1",
|
||||
"@vercel/ncc": "^0.36.1",
|
||||
"ansi-styles": "5.2.0",
|
||||
"eslint": "^8.46.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-jest": "^27.2.3",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"jest": "^29.6.2",
|
||||
@@ -1854,12 +1854,12 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "24.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz",
|
||||
"integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==",
|
||||
"version": "24.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.1.tgz",
|
||||
"integrity": "sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~7.8.0"
|
||||
"undici-types": "~7.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node-fetch": {
|
||||
@@ -3477,13 +3477,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-config-prettier": {
|
||||
"version": "8.10.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz",
|
||||
"integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==",
|
||||
"version": "10.1.8",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz",
|
||||
"integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"eslint-config-prettier": "bin/cli.js"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/eslint-config-prettier"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": ">=7.0.0"
|
||||
}
|
||||
@@ -7522,9 +7526,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
||||
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
|
||||
"version": "7.10.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz",
|
||||
"integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/universal-user-agent": {
|
||||
|
||||
@@ -48,14 +48,14 @@
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/lodash.deburr": "^4.1.6",
|
||||
"@types/node": "^24.1.0",
|
||||
"@types/node": "^24.3.1",
|
||||
"@types/semver": "^7.5.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
||||
"@typescript-eslint/parser": "^6.2.1",
|
||||
"@vercel/ncc": "^0.36.1",
|
||||
"ansi-styles": "5.2.0",
|
||||
"eslint": "^8.46.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-jest": "^27.2.3",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"jest": "^29.6.2",
|
||||
|
||||
@@ -660,11 +660,22 @@ export class IssuesProcessor {
|
||||
|
||||
async getRateLimit(): Promise<IRateLimit | undefined> {
|
||||
const logger: Logger = new Logger();
|
||||
|
||||
try {
|
||||
const rateLimitResult = await this.client.rest.rateLimit.get();
|
||||
return new RateLimit(rateLimitResult.data.rate);
|
||||
} catch (error) {
|
||||
logger.error(`Error when getting rateLimit: ${error.message}`);
|
||||
} catch (error: unknown) {
|
||||
const status = (error as {status?: number})?.status;
|
||||
const message = (error as {message?: string})?.message ?? String(error);
|
||||
|
||||
if (status === 404 && message.includes('Rate limiting is not enabled')) {
|
||||
logger.warning(
|
||||
'Rate limiting is not enabled on this instance. Proceeding without rate limit checks.'
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
logger.error(`Error when getting rateLimit: ${message}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,12 +33,14 @@ const getOctokitClient = () => {
|
||||
const checkIfCacheExists = async (cacheKey: string): Promise<boolean> => {
|
||||
const client = getOctokitClient();
|
||||
try {
|
||||
const issueResult = await client.request(
|
||||
`/repos/${context.repo.owner}/${context.repo.repo}/actions/caches`
|
||||
);
|
||||
const cachesResult = await client.rest.actions.getActionsCacheList({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
key: cacheKey // prefix matching
|
||||
});
|
||||
const caches: Array<{key?: string}> =
|
||||
issueResult.data['actions_caches'] || [];
|
||||
return Boolean(caches.find(cache => cache['key'] === cacheKey));
|
||||
cachesResult.data['actions_caches'] || [];
|
||||
return caches.some(cache => cache['key'] === cacheKey);
|
||||
} catch (error) {
|
||||
core.debug(`Error checking if cache exist: ${error.message}`);
|
||||
}
|
||||
@@ -48,10 +50,11 @@ const resetCacheWithOctokit = async (cacheKey: string): Promise<void> => {
|
||||
const client = getOctokitClient();
|
||||
core.debug(`remove cache "${cacheKey}"`);
|
||||
try {
|
||||
// TODO: replace with client.rest.
|
||||
await client.request(
|
||||
`DELETE /repos/${context.repo.owner}/${context.repo.repo}/actions/caches?key=${cacheKey}`
|
||||
);
|
||||
await client.rest.actions.deleteActionsCacheByKey({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
key: cacheKey
|
||||
});
|
||||
} catch (error) {
|
||||
if (error.status) {
|
||||
core.warning(
|
||||
|
||||
@@ -124,7 +124,8 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
|
||||
ignorePrUpdates: _toOptionalBoolean('ignore-pr-updates'),
|
||||
exemptDraftPr: core.getInput('exempt-draft-pr') === 'true',
|
||||
closeIssueReason: core.getInput('close-issue-reason'),
|
||||
includeOnlyAssigned: core.getInput('include-only-assigned') === 'true'
|
||||
includeOnlyAssigned: core.getInput('include-only-assigned') === 'true',
|
||||
onlyIssueTypes: core.getInput('only-issue-types')
|
||||
};
|
||||
|
||||
for (const numberInput of ['days-before-stale']) {
|
||||
|
||||
Reference in New Issue
Block a user