Skip to content

Commit

Permalink
fix(README): set installationId in code example (#350)
Browse files Browse the repository at this point in the history
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
  • Loading branch information
ng-galien and gr2m committed Sep 30, 2022
1 parent efda5f9 commit 2e69265
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,16 @@ const app = new App({

const { data } = await app.octokit.request("/app");
console.log("authenticated as %s", data.name);

for await (const { octokit, repository } of app.eachRepository.iterator()) {
await octokit.request("POST /repos/{owner}/{repo}/dispatches", {
owner: repository.owner.login,
repo: repository.name,
event_type: "my_event",
});
for await (const { installation } of app.eachInstallation.iterator()) {
for await (const { octokit, repository } of app.eachRepository.iterator({
installationId: installation.id,
})) {
await octokit.request("POST /repos/{owner}/{repo}/dispatches", {
owner: repository.owner.login,
repo: repository.name,
event_type: "my_event",
});
}
}

app.webhooks.on("issues.opened", async ({ octokit, payload }) => {
Expand Down

0 comments on commit 2e69265

Please sign in to comment.