Skip to content

Commit 04cc9ae

Browse files
committed
Add Subtask ID Automation
1 parent 3485e01 commit 04cc9ae

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/add_issue_to_project_task_board.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,31 @@ jobs:
110110
id
111111
}
112112
}
113-
}' -f projectId=$PROJECT_ID -f projectItemId=$PROJECT_ITEM_ID -f fieldId=$MAIN_TASK_FIELD_ID -f value="Documentation"
113+
}' -f projectId=$PROJECT_ID -f projectItemId=$PROJECT_ITEM_ID -f fieldId=$MAIN_TASK_FIELD_ID -f value="Documentation - Stereum"
114114
fi
115115
116116
if [ -n "$SUB_TASK_FIELD_ID" ]; then
117+
LABEL_NAME="${{ github.event.issue.labels[0].name }}"
118+
if [[ "$LABEL_NAME" == "doc enhancement" ]]; then
119+
SUB_TASK_NAME="Documentation - Stereum | Doc Enhancement"
120+
elif [[ "$LABEL_NAME" == "fix" ]]; then
121+
SUB_TASK_NAME="Documentation - Stereum | Fix"
122+
elif [[ "$LABEL_NAME" == "new docs" ]]; then
123+
SUB_TASK_NAME="Documentation - Stereum | New Docs"
124+
elif [[ "$LABEL_NAME" == "translation" ]]; then
125+
SUB_TASK_NAME="Documentation - Stereum | Translation"
126+
else
127+
SUB_TASK_NAME="Documentation - Stereum | General"
128+
fi
129+
117130
gh api graphql -f query='
118131
mutation($projectId: ID!, $projectItemId: ID!, $fieldId: ID!, $value: String!) {
119132
updateProjectV2ItemFieldValue(input: {projectId: $projectId, itemId: $projectItemId, fieldId: $fieldId, value: {text: $value}}) {
120133
projectV2Item {
121134
id
122135
}
123136
}
124-
}' -f projectId=$PROJECT_ID -f projectItemId=$PROJECT_ITEM_ID -f fieldId=$SUB_TASK_FIELD_ID -f value="Stereum Documentation"
137+
}' -f projectId=$PROJECT_ID -f projectItemId=$PROJECT_ITEM_ID -f fieldId=$SUB_TASK_FIELD_ID -f value="$SUB_TASK_NAME"
125138
fi
126139
127140
if [ -n "$STATUS_FIELD_ID" ] && [ -n "$BACKLOG_OPTION_ID" ]; then

0 commit comments

Comments
 (0)