mirror of
https://github.com/actions/add-to-project.git
synced 2025-12-11 12:37:16 +00:00
Build and package
This commit is contained in:
20
dist/index.js
generated
vendored
20
dist/index.js
generated
vendored
@@ -85,34 +85,36 @@ function addToProject() {
|
|||||||
core.debug(`Project number: ${projectNumber}`);
|
core.debug(`Project number: ${projectNumber}`);
|
||||||
core.debug(`Owner type: ${ownerType}`);
|
core.debug(`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($ownerName: String!, $projectNumber: Int!) {
|
const idResp = yield octokit.graphql(`query getProject($ownerName: String!, $projectNumber: Int!) {
|
||||||
${ownerTypeQuery}(login: $ownerName) {
|
${ownerTypeQuery}(login: $ownerName) {
|
||||||
projectNext(number: $projectNumber) {
|
projectV2(number: $projectNumber) {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}`, {
|
}`, {
|
||||||
ownerName,
|
ownerName,
|
||||||
projectNumber
|
projectNumber,
|
||||||
|
headers: { 'GraphQL-Features': 'memex_graphql_projectv2' }
|
||||||
});
|
});
|
||||||
const projectId = (_h = idResp[ownerTypeQuery]) === null || _h === void 0 ? void 0 : _h.projectNext.id;
|
const projectId = (_h = idResp[ownerTypeQuery]) === null || _h === void 0 ? void 0 : _h.projectV2.id;
|
||||||
const contentId = issue === null || issue === void 0 ? void 0 : issue.node_id;
|
const contentId = issue === null || issue === void 0 ? void 0 : issue.node_id;
|
||||||
core.debug(`Project node ID: ${projectId}`);
|
core.debug(`Project node ID: ${projectId}`);
|
||||||
core.debug(`Content ID: ${contentId}`);
|
core.debug(`Content ID: ${contentId}`);
|
||||||
// Next, use the GraphQL API to add the issue to the project.
|
// Next, use the GraphQL API to add the issue to the project.
|
||||||
const addResp = yield octokit.graphql(`mutation addIssueToProject($input: AddProjectNextItemInput!) {
|
const addResp = yield octokit.graphql(`mutation addIssueToProject($input: AddProjectV2ItemByIdInput!) {
|
||||||
addProjectNextItem(input: $input) {
|
addProjectV2ItemById(input: $input) {
|
||||||
projectNextItem {
|
projectItem {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}`, {
|
}`, {
|
||||||
input: {
|
input: {
|
||||||
|
projectId,
|
||||||
contentId,
|
contentId,
|
||||||
projectId
|
headers: { 'GraphQL-Features': 'memex_graphql_projectv2' }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
core.setOutput('itemId', addResp.addProjectNextItem.projectNextItem.id);
|
core.setOutput('itemId', addResp.addProjectV2ItemById.projectItem.id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.addToProject = addToProject;
|
exports.addToProject = addToProject;
|
||||||
|
|||||||
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
Reference in New Issue
Block a user