The following project is a cron job that formats GitHub project data into Discord messages.
To set up the project, follow these steps:
- Clone the repository:
git clone https://github.com/your-username/github-project-reminders.git
- Navigate to the project directory:
cd github-project-reminders
- Install the required dependencies:
npm install
- Install dotenv-cli
npm install -g dotenv-cli
- Create a "test" Discord channel webhook
- Create a private Discord text channel and click settings
- Create a webhook on the integrations screen and copy the webhook url
- Create a
.env
file with the webhook url
DISCORD_CHANNEL_WEBHOOK_URL=YOUR_WEBHOOK_URL_HERE
GITHUB_ACCESS_TOKEN=(ask Matthew for this)
- Start the job:
npm run prod <jobname>
Job Name | Description |
---|---|
dailyTaskReminder |
Sends the reminder for upcoming tasks on a daily basis |
promotionReminder |
Sends the reminder for promotional materials due in the next 24 hours |
Project Number Query:
{
organization(login: "CarletonComputerScienceSociety") {
id
projectsV2(first: 10) {
nodes {
id
title
number
}
}
}
}
Project Query
{
organization(login: "CarletonComputerScienceSociety") {
projectV2(number: 19) {
id
}
}
}
Project Items Query
{
organization(login: "CarletonComputerScienceSociety") {
projectV2(number: 18) {
items(first: 100) {
nodes {
id
content {
... on DraftIssue {
title
}
... on Issue {
title
url
}
}
fieldValueByName(name: "Due") {
... on ProjectV2ItemFieldDateValue {
id
date
}
}
fieldValues(first: 10) {
nodes {
... on ProjectV2ItemFieldDateValue {
id
date
}
... on ProjectV2ItemFieldUserValue {
users(first: 5) {
nodes {
id
url
}
}
}
... on ProjectV2ItemFieldSingleSelectValue {
id
name
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
}