Skip to content

luiarhs/pullrequest-weekly-report

Repository files navigation

Pull requests weekly report

Azure Function App that will use the GitHub API to retrieve a summary of all opened, closed, and in progress pull requests in the last week for a given repository and print an email summary report that might be sent to a given email.

Configure your local environment

  • An Azure account with an active subscription One of the following tools for creating Azure resources:
  • Azure CLI version 2.4 or later.
  • The Azure Az PowerShell module version 5.9.0 or later.
  • Node.js version 18 or above.

Install the Azure Functions Core Tools

https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-node?tabs=macos%2Cazure-cli%2Cbrowser&pivots=nodejs-model-v4#install-the-azure-functions-core-tools

Getting Started

use command-line tools to create a JavaScript function that responds to HTTP requests. After testing the code locally, you deploy it to the serverless environment of Azure Functions.

Run the function locally

func start

https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-node?tabs=macos%2Cazure-cli%2Cbrowser&pivots=nodejs-model-v4

Environment Variables

the function uses the following environment variables in the local.settings.json file or in the Azure portal:

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
    "AzureWebJobsStorage": "UseDevelopmentStorage=true", // or your Azure Storage connection string
    "EMAIL_TO": "[email protected]",
    "GITHUB_URL": "https://api.github.com/graphql",
    "GITHUB_TOKEN": "ghp_key",
    "GITHUB_REPO": "owner/repo",
    "SENDGRID_API_KEY": "SG.-key",
    "SENDGRID_FROM_EMAIL": "[email protected]"
  }
}

About

Pull Requests weekly report

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published