Skip to content

CarletonComputerScienceSociety/github-projects-discord-reminders

Repository files navigation

Github Project Reminders

The following project is a cron job that formats GitHub project data into Discord messages.

Setup

To set up the project, follow these steps:

  1. Clone the repository:
git clone https://github.com/your-username/github-project-reminders.git
  1. Navigate to the project directory:
cd github-project-reminders
  1. Install the required dependencies:
npm install
  1. Install dotenv-cli
npm install -g dotenv-cli
  1. 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

instructions instructions2

  1. Create a .env file with the webhook url
DISCORD_CHANNEL_WEBHOOK_URL=YOUR_WEBHOOK_URL_HERE
GITHUB_ACCESS_TOKEN=(ask Matthew for this)
  1. Start the job:
npm run prod <jobname>

Jobs

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

Notes

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
        }
      }
    }
  }
}

About

Cron job that formats GitHub project data into Discord messages.

Resources

Stars

Watchers

Forks