-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
7,376 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
# create PRs for out-of-range updates | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
versioning-strategy: "increase" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 12 | ||
- run: npx semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.PROBOTBOT_NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Test | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
- run: npm ci | ||
- run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
coverage | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module.exports = azureFunction; | ||
|
||
/** | ||
* @param {import('probot').Probot} probot | ||
* @param {import('@azure/functions').Context} context | ||
* @param {import('@azure/functions').HttpRequest} req | ||
*/ | ||
async function azureFunction(probot, context, req) { | ||
// this will be simpler once we ship `verifyAndParse()` | ||
// see https://github.com/octokit/webhooks.js/issues/379 | ||
await probot.webhooks.verifyAndReceive({ | ||
id: req.headers["X-GitHub-Delivery"] || req.headers["x-github-delivery"], | ||
name: req.headers["X-GitHub-Event"] || req.headers["x-github-event"], | ||
signature: | ||
req.headers["X-Hub-Signature-256"] || | ||
req.headers["x-hub-signature-256"] || | ||
req.headers["X-Hub-Signature"] || | ||
req.headers["x-hub-signature"], | ||
payload: req.body, | ||
}); | ||
|
||
context.res = { | ||
status: "200", | ||
body: "ok", | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const ProbotExports = require("probot"); | ||
const azureFunction = require("./azure-function"); | ||
|
||
module.exports = { ...ProbotExports, createAzureFunction }; | ||
|
||
/** | ||
* | ||
* @param {import('probot').ApplicationFunction} app | ||
* @param { { probot: import('probot').Probot } } options | ||
*/ | ||
function createAzureFunction(app, { probot }) { | ||
// load app once outside of the function to prevent double | ||
// event handlers in case of container reuse | ||
probot.load(app); | ||
|
||
return azureFunction.bind(null, probot); | ||
} |
Oops, something went wrong.