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.
- 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
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.
func start
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]"
}
}