From 2fb6eca7b0c0970f1d0243a0da594340e347744a Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Sat, 4 Jun 2022 01:27:02 +0300 Subject: [PATCH] ci: Fix imports in 'actions/github-script' (#3626) --- .github/workflows/cmd-publish-pr-on-npm.yml | 4 ++-- .github/workflows/cmd-run-benchmark.yml | 2 +- .github/workflows/github-actions-bot.yml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmd-publish-pr-on-npm.yml b/.github/workflows/cmd-publish-pr-on-npm.yml index 66d84d58a0..115736fa70 100644 --- a/.github/workflows/cmd-publish-pr-on-npm.yml +++ b/.github/workflows/cmd-publish-pr-on-npm.yml @@ -68,8 +68,8 @@ jobs: uses: actions/github-script@v6 with: script: | - import fs from 'node:fs'; - import assert from 'node:assert'; + const fs = require('node:fs'); + const assert = require('node:assert'); const pull_request = JSON.parse(process.env.PULL_REQUEST_JSON); const packageJSONPath = './npmDist/package.json'; diff --git a/.github/workflows/cmd-run-benchmark.yml b/.github/workflows/cmd-run-benchmark.yml index 65b858ec17..f17e7ed2f0 100644 --- a/.github/workflows/cmd-run-benchmark.yml +++ b/.github/workflows/cmd-run-benchmark.yml @@ -39,7 +39,7 @@ jobs: uses: actions/github-script@v6 with: script: | - import fs from 'node:fs'; + const fs = require('node:fs'); // GH doesn't expose job's id so we need to get it through API, see // https://github.community/t/job-id-is-string-in-github-job-but-integer-in-actions-api/139060 diff --git a/.github/workflows/github-actions-bot.yml b/.github/workflows/github-actions-bot.yml index 810cef74e3..fccdb4ebae 100644 --- a/.github/workflows/github-actions-bot.yml +++ b/.github/workflows/github-actions-bot.yml @@ -37,7 +37,7 @@ jobs: uses: actions/github-script@v6 with: script: | - import fs from 'node:fs'; + const fs = require('node:fs'); const event = JSON.parse(fs.readFileSync('./event.json', 'utf8')); await github.rest.issues.createComment({ @@ -110,7 +110,7 @@ jobs: uses: actions/github-script@v6 with: script: | - import fs from 'node:fs'; + const fs = require('node:fs'); const needs = JSON.parse(process.env.NEEDS); @@ -134,7 +134,7 @@ jobs: uses: actions/github-script@v6 with: script: | - import fs from 'node:fs'; + const fs = require('node:fs'); const replyMessage = fs.readFileSync('./replyMessage.txt', 'utf-8'); const { issue, comment, sender } = context.payload;