Skip to content

Commit

Permalink
chore: yet again
Browse files Browse the repository at this point in the history
  • Loading branch information
reinamora137 committed Sep 10, 2024
1 parent 8945ca4 commit 74356fa
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/new_discussion_to_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ jobs:
console.log('Event payload:', JSON.stringify(eventPayload, null, 2));
const orgLogin = eventPayload.organization.login;
const repoName = eventPayload.repository.name;
const discussion = eventPayload.discussion;
console.log(`Organization: ${orgLogin}, Discussion Number: ${discussion.number}`);
console.log(`Organization: ${orgLogin}, Repository: ${repoName}, Discussion Number: ${discussion.number}`);
// First, get the project ID
const getProjectIdQuery = `
Expand Down Expand Up @@ -65,10 +66,19 @@ jobs:
`;
try {
// First, get the discussion ID using the discussion number
const { data: { discussion: discussionData } } = await github.rest.discussions.get({
owner: orgLogin,
repo: repoName,
discussion_number: discussion.number
});
console.log('Discussion data:', JSON.stringify(discussionData, null, 2));
const result = await github.graphql(addToProjectMutation, {
input: {
projectId: projectId,
contentId: discussion.node_id
contentId: discussionData.node_id
}
});
Expand Down

0 comments on commit 74356fa

Please sign in to comment.