From dd98f14594d423f474be686bd0b2c18e9d7ed965 Mon Sep 17 00:00:00 2001 From: Maksim Beliaev Date: Fri, 20 Dec 2024 17:44:40 +0100 Subject: [PATCH] Update automatically-redelivering-failed-deliveries-for-a-github-app-webhook.md (#35605) Co-authored-by: Alex Nguyen <150945400+nguyenalex836@users.noreply.github.com> --- ...livering-failed-deliveries-for-a-github-app-webhook.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-a-github-app-webhook.md b/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-a-github-app-webhook.md index 643ae0254f4b..9309fe1181fe 100644 --- a/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-a-github-app-webhook.md +++ b/content/webhooks/using-webhooks/automatically-redelivering-failed-deliveries-for-a-github-app-webhook.md @@ -76,7 +76,7 @@ jobs: - name: Setup Node.js uses: {% data reusables.actions.action-setup-node %} with: - node-version: '18.x' + node-version: '20.x' # This step installs the octokit library. The script that this workflow will run uses the octokit library. - name: Install dependencies @@ -98,18 +98,18 @@ jobs: WORKFLOW_REPO: {% raw %}${{ github.event.repository.name }}{% endraw %} WORKFLOW_REPO_OWNER: {% raw %}${{ github.repository_owner }}{% endraw %} run: | - node .github/workflows/scripts/redeliver-failed-deliveries.js + node .github/workflows/scripts/redeliver-failed-deliveries.mjs ``` ## Adding the script This section demonstrates how you can write a script to find and redeliver failed deliveries. -Copy this script into a file called `.github/workflows/scripts/redeliver-failed-deliveries.js` in the same repository where you saved the {% data variables.product.prodname_actions %} workflow file above. +Copy this script into a file called `.github/workflows/scripts/redeliver-failed-deliveries.mjs` in the same repository where you saved the {% data variables.product.prodname_actions %} workflow file above. ```javascript copy annotate // This script uses {% data variables.product.company_short %}'s Octokit SDK to make API requests. For more information, see "[AUTOTITLE](/rest/guides/scripting-with-the-rest-api-and-javascript)." -const { App, Octokit } = require("octokit"); +import { App, Octokit } from "octokit"; // async function checkAndRedeliverWebhooks() {