mirror of
https://github.com/actions/add-to-project.git
synced 2025-12-12 13:07:21 +00:00
Merge pull request #595 from actions/dependabot/npm_and_yarn/typescript-5.5.2
build(deps-dev): bump typescript from 5.4.5 to 5.5.2
This commit is contained in:
@@ -137,6 +137,7 @@ Using these events ensure that a given issue or pull request, in the workflow's
|
|||||||
## Creating a PAT and adding it to your repository
|
## Creating a PAT and adding it to your repository
|
||||||
|
|
||||||
- Create a new [personal access token](https://github.com/settings/tokens/new). _See [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for more information_
|
- Create a new [personal access token](https://github.com/settings/tokens/new). _See [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for more information_
|
||||||
|
|
||||||
- For **Tokens (classic)** include the `project` scope; for private repos you will also need `repo` scope.
|
- For **Tokens (classic)** include the `project` scope; for private repos you will also need `repo` scope.
|
||||||
- For **Fine-grained tokens**, you must first select the appropriate _owner_ and associated _repositories_. Then select _Organization permissions -> `projects` `read & write`_, and _Repository permissions -> `issues` `read-only`_ and _`pull requests` `read-only`_.
|
- For **Fine-grained tokens**, you must first select the appropriate _owner_ and associated _repositories_. Then select _Organization permissions -> `projects` `read & write`_, and _Repository permissions -> `issues` `read-only`_ and _`pull requests` `read-only`_.
|
||||||
|
|
||||||
|
|||||||
24
dist/index.js
generated
vendored
24
dist/index.js
generated
vendored
@@ -29,22 +29,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.mustGetOwnerTypeQuery = exports.addToProject = void 0;
|
exports.addToProject = addToProject;
|
||||||
|
exports.mustGetOwnerTypeQuery = mustGetOwnerTypeQuery;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const github = __importStar(__nccwpck_require__(5438));
|
const github = __importStar(__nccwpck_require__(5438));
|
||||||
const urlParse = /\/(?<ownerType>orgs|users)\/(?<ownerName>[^/]+)\/projects\/(?<projectNumber>\d+)/;
|
const urlParse = /\/(?<ownerType>orgs|users)\/(?<ownerName>[^/]+)\/projects\/(?<projectNumber>\d+)/;
|
||||||
function addToProject() {
|
async function addToProject() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
||||||
const projectUrl = core.getInput('project-url', { required: true });
|
const projectUrl = core.getInput('project-url', { required: true });
|
||||||
const ghToken = core.getInput('github-token', { required: true });
|
const ghToken = core.getInput('github-token', { required: true });
|
||||||
@@ -92,7 +83,7 @@ function addToProject() {
|
|||||||
core.debug(`Project number: ${projectNumber}`);
|
core.debug(`Project number: ${projectNumber}`);
|
||||||
core.debug(`Project owner type: ${ownerType}`);
|
core.debug(`Project owner type: ${ownerType}`);
|
||||||
// First, use the GraphQL API to request the project's node ID.
|
// First, use the GraphQL API to request the project's node ID.
|
||||||
const idResp = yield octokit.graphql(`query getProject($projectOwnerName: String!, $projectNumber: Int!) {
|
const idResp = await octokit.graphql(`query getProject($projectOwnerName: String!, $projectNumber: Int!) {
|
||||||
${ownerTypeQuery}(login: $projectOwnerName) {
|
${ownerTypeQuery}(login: $projectOwnerName) {
|
||||||
projectV2(number: $projectNumber) {
|
projectV2(number: $projectNumber) {
|
||||||
id
|
id
|
||||||
@@ -111,7 +102,7 @@ function addToProject() {
|
|||||||
// add a project item. Otherwise, we add a draft issue.
|
// add a project item. Otherwise, we add a draft issue.
|
||||||
if (issueOwnerName === projectOwnerName) {
|
if (issueOwnerName === projectOwnerName) {
|
||||||
core.info('Creating project item');
|
core.info('Creating project item');
|
||||||
const addResp = yield octokit.graphql(`mutation addIssueToProject($input: AddProjectV2ItemByIdInput!) {
|
const addResp = await octokit.graphql(`mutation addIssueToProject($input: AddProjectV2ItemByIdInput!) {
|
||||||
addProjectV2ItemById(input: $input) {
|
addProjectV2ItemById(input: $input) {
|
||||||
item {
|
item {
|
||||||
id
|
id
|
||||||
@@ -127,7 +118,7 @@ function addToProject() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.info('Creating draft issue in project');
|
core.info('Creating draft issue in project');
|
||||||
const addResp = yield octokit.graphql(`mutation addDraftIssueToProject($projectId: ID!, $title: String!) {
|
const addResp = await octokit.graphql(`mutation addDraftIssueToProject($projectId: ID!, $title: String!) {
|
||||||
addProjectV2DraftIssue(input: {
|
addProjectV2DraftIssue(input: {
|
||||||
projectId: $projectId,
|
projectId: $projectId,
|
||||||
title: $title
|
title: $title
|
||||||
@@ -142,9 +133,7 @@ function addToProject() {
|
|||||||
});
|
});
|
||||||
core.setOutput('itemId', addResp.addProjectV2DraftIssue.projectItem.id);
|
core.setOutput('itemId', addResp.addProjectV2DraftIssue.projectItem.id);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.addToProject = addToProject;
|
|
||||||
function mustGetOwnerTypeQuery(ownerType) {
|
function mustGetOwnerTypeQuery(ownerType) {
|
||||||
const ownerTypeQuery = ownerType === 'orgs' ? 'organization' : ownerType === 'users' ? 'user' : null;
|
const ownerTypeQuery = ownerType === 'orgs' ? 'organization' : ownerType === 'users' ? 'user' : null;
|
||||||
if (!ownerTypeQuery) {
|
if (!ownerTypeQuery) {
|
||||||
@@ -152,7 +141,6 @@ function mustGetOwnerTypeQuery(ownerType) {
|
|||||||
}
|
}
|
||||||
return ownerTypeQuery;
|
return ownerTypeQuery;
|
||||||
}
|
}
|
||||||
exports.mustGetOwnerTypeQuery = mustGetOwnerTypeQuery;
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|||||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
14
package-lock.json
generated
14
package-lock.json
generated
@@ -27,7 +27,7 @@
|
|||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "3.3.2",
|
"prettier": "3.3.2",
|
||||||
"ts-jest": "^29.1.5",
|
"ts-jest": "^29.1.5",
|
||||||
"typescript": "^5.4.5"
|
"typescript": "^5.5.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20.0.0",
|
"node": ">=20.0.0",
|
||||||
@@ -6880,9 +6880,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.4.5",
|
"version": "5.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz",
|
||||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
"integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
@@ -12153,9 +12153,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "5.4.5",
|
"version": "5.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz",
|
||||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
"integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"unbox-primitive": {
|
"unbox-primitive": {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "3.3.2",
|
"prettier": "3.3.2",
|
||||||
"ts-jest": "^29.1.5",
|
"ts-jest": "^29.1.5",
|
||||||
"typescript": "^5.4.5"
|
"typescript": "^5.5.2"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"actions",
|
"actions",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2015" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
|
"target": "ES2018" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
|
||||||
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
|
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
|
||||||
"outDir": "./lib" /* Redirect output structure to the directory. */,
|
"outDir": "./lib" /* Redirect output structure to the directory. */,
|
||||||
"rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
|
"rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
|
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
|
||||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
||||||
"noUncheckedIndexedAccess": true,
|
"noUncheckedIndexedAccess": true,
|
||||||
"lib": ["ES2015"]
|
"lib": ["ES2018"]
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "**/*.test.ts"]
|
"exclude": ["node_modules", "**/*.test.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user