Skip to content

Commit 82ef901

Browse files
committed
Refactor logging and comments in add-to-backlog-project workflow for clarity
1 parent 4f32df2 commit 82ef901

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

.github/workflows/add-to-backlog-project.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
github-token: ${{ steps.auth.outputs.token }}
3131
script: |
3232
const org = context.repo.owner;
33-
const projectP1 = "PVT_kwDOClHx584AyckH"; // Project ID for "Refinement Board"
33+
const projectP1 = "PVT_kwDOClHx584AyckH"; // Project ID for "Refinement Board"
3434
const projectP2 = "PVT_kwDOClHx584AwGgJ"; // Project ID for "Backlog Project"
35-
const statusFieldIdP1 = "PVTSSF_lADOClHx584AyckHzgoZZ94"; // Status field ID for Refinement Board
36-
const statusFieldIdP2 = "PVTSSF_lADOClHx584AwGgJzgmbNBk"; // Status field ID for Project Backlog
35+
const statusFieldIdP1 = "PVTSSF_lADOClHx584AyckHzgoZZ94"; // Issue Status field ID for Refinement Board
36+
const statusFieldIdP2 = "PVTSSF_lADOClHx584AwGgJzgmbNBk"; // Issue Status field ID for Project Backlog
3737
const doneStatus = "6c6113eb"; // "Done" Status Option ID of Refinement Board
3838
const todoStatus = "f75ad846"; // "ToDo Status Option ID of Backlog Project
3939
@@ -81,19 +81,6 @@ jobs:
8181
const result = await github.graphql(query);
8282
const items = result.node.items.nodes;
8383
84-
console.log("Issues retrieved!");
85-
console.log(items);
86-
87-
items.forEach(item => {
88-
console.log(`Item ID: ${item.id}`);
89-
item.fieldValues.nodes.forEach(f => {
90-
console.log(` - Type: ${f.__typename}`);
91-
console.log(` - Field ID: ${f.field?.id}`);
92-
console.log(` - Option ID: ${f.optionId}`);
93-
console.log("Field Value Object:", JSON.stringify(f, null, 2));
94-
});
95-
});
96-
9784
// Filter only issues with "Done" status
9885
const doneItems = items.filter(item =>
9986
item.fieldValues.nodes.some(f => f.__typename === "ProjectV2ItemFieldSingleSelectValue" &&
@@ -110,7 +97,7 @@ jobs:
11097
if (!item.content || !item.content.number) continue;
11198
11299
const issueNumber = item.content.number;
113-
console.log(`Moving issue #${issueNumber} from Refinement Board to Project Backlog ...`);
100+
console.log(`Adding issue #${issueNumber} to Project Backlog ...`);
114101
115102
// Add issue to Project Backlog
116103
const addToProjectMutation = `
@@ -148,4 +135,4 @@ jobs:
148135
await github.graphql(updateStatusMutation);
149136
150137
console.log(`Issue #${issueNumber} added to Project Backlog with status "To Do".`);
151-
}
138+
}

0 commit comments

Comments
 (0)