From 7cc513ea2564ee7ac6c4141009517a58af7aa94b Mon Sep 17 00:00:00 2001 From: Julia Gschwend Date: Mon, 26 Aug 2024 16:13:48 -0300 Subject: [PATCH] Update add_to_project.yml --- .github/workflows/add_to_project.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/add_to_project.yml b/.github/workflows/add_to_project.yml index 7094afb..a357b5a 100644 --- a/.github/workflows/add_to_project.yml +++ b/.github/workflows/add_to_project.yml @@ -13,22 +13,21 @@ jobs: uses: actions/github-script@v6 with: script: | - const projectNumber = 39; + const projectName = "Software"; const columnName = "Backlog"; - // Fetch the project - const { data: projects } = await github.projects.listForRepo({ + // Fetch the repository projects + const projects = await github.rest.projects.listForRepo({ owner: context.repo.owner, repo: context.repo.repo }); - const project = projects.find(p => p.name === "Software"); + const project = projects.data.find(p => p.name === projectName); if (!project) { - core.setFailed("Project 'Software' not found"); + core.setFailed(`Project '${projectName}' not found`); return; } - // Fetch the columns of the project const { data: columns } = await github.projects.listColumns({ project_id: project.id @@ -52,6 +51,5 @@ jobs: await github.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, - issue_number: context.issue.number, - area: '🌠 Science Server' + issue_number: context.issue.number });