Skip to content

Commit

Permalink
chore: workflow annoying
Browse files Browse the repository at this point in the history
  • Loading branch information
reinamora137 committed Sep 10, 2024
1 parent a1d2c91 commit 2084306
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/new_discussion_to_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Get discussion details and add to project
- name: Add discussion to project
uses: actions/github-script@v7
with:
github-token: ${{ steps.generate_token.outputs.token }}
Expand All @@ -26,20 +26,11 @@ jobs:
const orgLogin = eventPayload.organization.login;
const repoName = eventPayload.repository.name;
const discussionNumber = eventPayload.discussion.number;
const discussion = eventPayload.discussion;
console.log(`Organization: ${orgLogin}, Repository: ${repoName}, Discussion Number: ${discussionNumber}`);
console.log(`Organization: ${orgLogin}, Repository: ${repoName}, Discussion Number: ${discussion.number}`);
try {
// Fetch discussion details
const { data: discussion } = await github.rest.discussions.get({
owner: orgLogin,
repo: repoName,
discussion_number: discussionNumber
});
console.log('Discussion details:', JSON.stringify(discussion, null, 2));
// Add discussion to project
const response = await github.rest.projects.createCard({
column_id: 'YOUR_PROJECT_COLUMN_ID',
Expand Down

0 comments on commit 2084306

Please sign in to comment.