mirror of
https://github.com/peter-evans/create-pull-request.git
synced 2026-05-14 10:32:42 +00:00
5f6978faf0
Add retry logic to handle GitHub API eventual consistency errors that can occur after creating a new pull request. Follow-up API calls for milestones, labels, assignees, and reviewers may fail with a 422 "Could not resolve to a node" error before the PR is fully propagated. - Add generic `retryWithBackoff` helper in `src/utils.ts` with exponential backoff (default 2 retries, starting at 1s delay) - Wrap post-creation API calls in `src/github-helper.ts` with `withRetryForNewPr()`, which only retries for newly created PRs - Use `@octokit/request-error` `RequestError` type for precise error matching (status 422 + "Could not resolve to a node" message) - Add unit tests for `retryWithBackoff` covering success, retry, exhaustion, and non-retryable error scenarios - Update `dist/index.js` bundle and `package.json` dependencies
69 lines
2.0 KiB
JSON
69 lines
2.0 KiB
JSON
{
|
|
"name": "create-pull-request",
|
|
"version": "8.0.0",
|
|
"private": true,
|
|
"description": "Creates a pull request for changes to your repository in the actions workspace",
|
|
"main": "lib/main.js",
|
|
"engines": {
|
|
"node": ">=24.4.0"
|
|
},
|
|
"scripts": {
|
|
"build": "tsc && ncc build",
|
|
"format": "prettier --write '**/*.ts'",
|
|
"format-check": "prettier --check '**/*.ts'",
|
|
"lint": "eslint src/**/*.ts",
|
|
"test:unit": "jest unit",
|
|
"test:int": "__test__/integration-tests.sh",
|
|
"test": "npm run test:unit && npm run test:int"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/peter-evans/create-pull-request.git"
|
|
},
|
|
"keywords": [
|
|
"actions",
|
|
"pull",
|
|
"request"
|
|
],
|
|
"author": "Peter Evans",
|
|
"license": "MIT",
|
|
"bugs": {
|
|
"url": "https://github.com/peter-evans/create-pull-request/issues"
|
|
},
|
|
"homepage": "https://github.com/peter-evans/create-pull-request",
|
|
"dependencies": {
|
|
"@actions/core": "^1.11.1",
|
|
"@actions/exec": "^1.1.1",
|
|
"@octokit/core": "^6.1.6",
|
|
"@octokit/plugin-paginate-rest": "^11.6.0",
|
|
"@octokit/plugin-rest-endpoint-methods": "^13.5.0",
|
|
"@octokit/plugin-retry": "^7.2.1",
|
|
"@octokit/plugin-throttling": "^9.6.1",
|
|
"@octokit/request-error": "^6.1.8",
|
|
"node-fetch-native": "^1.6.7",
|
|
"p-limit": "^6.2.0",
|
|
"uuid": "^9.0.1"
|
|
},
|
|
"devDependencies": {
|
|
"@types/jest": "^29.5.14",
|
|
"@types/node": "^18.19.130",
|
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
"@typescript-eslint/parser": "^7.18.0",
|
|
"@vercel/ncc": "^0.38.4",
|
|
"eslint": "^8.57.1",
|
|
"eslint-import-resolver-typescript": "^3.10.1",
|
|
"eslint-plugin-github": "^4.10.2",
|
|
"eslint-plugin-import": "^2.32.0",
|
|
"eslint-plugin-jest": "^27.9.0",
|
|
"eslint-plugin-prettier": "^5.5.5",
|
|
"jest": "^29.7.0",
|
|
"jest-circus": "^29.7.0",
|
|
"jest-environment-jsdom": "^30.3.0",
|
|
"js-yaml": "^4.1.1",
|
|
"prettier": "^3.8.1",
|
|
"ts-jest": "^29.4.9",
|
|
"typescript": "^5.9.3",
|
|
"undici": "^6.24.1"
|
|
}
|
|
}
|