Skip to content

Commit

Permalink
fix(ci): script paths (#7356)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored Nov 4, 2024
1 parent 2a5608e commit 828b0b6
Show file tree
Hide file tree
Showing 31 changed files with 56 additions and 56 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const { ConfigManager } = require("@zwave-js/config");
const JSONC = require("comment-json");
const fs = require("node:fs/promises");
const { formatWithDprint } = require("./utils");
const { formatWithDprint } = require("./utils.cjs");

/**
* @param {{github: Github, context: Context}} param
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/// <reference path="types.d.ts" />

const { reviewers } = require("./users");
const { reviewers } = require("./users.cjs");

/**
* @param {{github: Github, context: Context}} param
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { ConfigManager } = require("@zwave-js/config");
const { formatId } = require("@zwave-js/shared");
const JSONC = require("comment-json");
const fs = require("node:fs/promises");
const { formatWithDprint } = require("./utils");
const { formatWithDprint } = require("./utils.cjs");

/**
* @param {{github: Github, context: Context}} param
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/// <reference path="types.d.ts" />

const { reviewers } = require("./users");
const { reviewers } = require("./users.cjs");

/**
* @param {{github: Github, context: Context}} param
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/// <reference path="types.d.ts" />

const { authorizedUsers } = require("./users");
const { authorizedUsers } = require("./users.cjs");

/**
* @param {{github: Github, context: Context}} param
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

/// <reference path="types.d.ts" />

const { reviewers } = require("./users");
const { urls } = require("./utils");
const { reviewers } = require("./users.cjs");
const { urls } = require("./utils.cjs");

/**
* @param {{github: Github, context: Context}} param
Expand Down
25 changes: 25 additions & 0 deletions .github/bot-scripts/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
addCompatFlag: (...args) => require("./addCompatFlag.cjs")(...args),
addCompatFlagCreatePR: (...args) =>
require("./addCompatFlagCreatePR.cjs")(...args),
addFingerprint: (...args) => require("./addFingerprint.cjs")(...args),
addFingerprintCreatePR: (...args) =>
require("./addFingerprintCreatePR.cjs")(...args),
approveWorkflows: (...args) => require("./approveWorkflows.cjs")(...args),
checkAuthorized: (...args) => require("./checkAuthorized.cjs")(...args),
ensureLogfile: (...args) => require("./ensureLogfile.cjs")(...args),
ensureLogfileInDiscussion: (...args) =>
require("./ensureLogfileInDiscussion.cjs")(...args),
fixLintFeedback: (...args) => require("./fixLintFeedback.cjs")(...args),
getFixLintInfo: (...args) => require("./getFixLintInfo.cjs")(...args),
rebaseFeedback: (...args) => require("./rebaseFeedback.cjs")(...args),
renameCommitGetPRInfo: (...args) =>
require("./renameCommitGetPRInfo.cjs")(...args),
renameCommitCheck: (...args) => require("./renameCommitCheck.cjs")(...args),
renameCommitFeedback: (...args) =>
require("./renameCommitFeedback.cjs")(...args),
importConfigCreatePR: (...args) =>
require("./importConfigCreatePR.cjs")(...args),
shouldAutomerge: (...args) => require("./shouldAutomerge.cjs")(...args),
packPr: (...args) => require("./packPr.cjs")(...args),
};
25 changes: 0 additions & 25 deletions .github/bot-scripts/index.js

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows-disabled/approve-workflow-runs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
github-token: ${{secrets.BOT_TOKEN}}
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
const workflows = [
".github/workflows/generate-docs.yml",
".github/workflows/test-and-release.yml",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }} # This doesn't need special permissions
result-encoding: string
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.shouldAutomerge({github, context});
- name: Approve PR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ jobs:
github-token: ${{secrets.BOT_TOKEN}}
result-encoding: string
script: |
const main = require(`${process.env.GITHUB_WORKSPACE}/.github/action-scripts/generateTypedDocs.js`);
const main = require(`${process.env.GITHUB_WORKSPACE}/.github/action-scripts/generateTypedDocs.cjs`);
return main({github, context});
4 changes: 2 additions & 2 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ jobs:
github-token: ${{secrets.BOT_TOKEN}}
result-encoding: string
script: |
const main = require(`${process.env.GITHUB_WORKSPACE}/.github/action-scripts/updateCCImplementationOverview.js`);
const main = require(`${process.env.GITHUB_WORKSPACE}/.github/action-scripts/updateCCImplementationOverview.cjs`);
return main({github, context});
# ===================
Expand Down Expand Up @@ -391,7 +391,7 @@ jobs:
github-token: ${{secrets.BOT_TOKEN}}
result-encoding: string
script: |
const main = require(`${process.env.GITHUB_WORKSPACE}/.github/action-scripts/updateToLogEntryOverview.js`);
const main = require(`${process.env.GITHUB_WORKSPACE}/.github/action-scripts/updateToLogEntryOverview.cjs`);
return main({github, context});
# ===================
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/zwave-js-bot_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
github-token: ${{ secrets.BOT_TOKEN }}
result-encoding: string
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.packPr({github, context});
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
github-token: ${{secrets.BOT_TOKEN}}
result-encoding: string
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/trusted/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/trusted/.github/bot-scripts/index.cjs`);
return bot.checkAuthorized({github, context});
# These steps only run if the check was successful
Expand All @@ -112,7 +112,7 @@ jobs:
uses: actions/github-script@v7
with:
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/trusted/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/trusted/.github/bot-scripts/index.cjs`);
const result = await bot.getFixLintInfo({github, context});
console.dir(result);
return result || {pending: true};
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
with:
github-token: ${{secrets.BOT_TOKEN}}
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/trusted/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/trusted/.github/bot-scripts/index.cjs`);
return bot.fixLintFeedback({github, context});
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
github-token: ${{secrets.BOT_TOKEN}}
result-encoding: string
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.checkAuthorized({github, context});
# These steps only run if the check was successful
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
with:
github-token: ${{secrets.BOT_TOKEN}}
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.rebaseFeedback({github, context});
# No longer needed
Expand Down Expand Up @@ -303,7 +303,7 @@ jobs:
# github-token: ${{secrets.BOT_TOKEN}}
# result-encoding: string
# script: |
# const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
# const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
# return (
# (await bot.checkAuthorized({github, context})) &&
# (await bot.renameCommitCheck({github, context}))
Expand All @@ -316,7 +316,7 @@ jobs:
# id: get-pr
# with:
# script: |
# const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
# const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
# return bot.renameCommitGetPRInfo({github, context});

# - name: Save our CI scripts
Expand Down Expand Up @@ -366,7 +366,7 @@ jobs:
# with:
# github-token: ${{secrets.BOT_TOKEN}}
# script: |
# const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
# const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
# return bot.renameCommitFeedback({github, context});

# #########################################################################
Expand All @@ -393,7 +393,7 @@ jobs:
github-token: ${{secrets.BOT_TOKEN}}
result-encoding: string
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.checkAuthorized({github, context});
# These steps only run if the check was successful
Expand Down Expand Up @@ -465,7 +465,7 @@ jobs:
with:
github-token: ${{secrets.BOT_TOKEN}}
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.importConfigCreatePR({github, context});
Expand Down Expand Up @@ -497,7 +497,7 @@ jobs:
github-token: ${{secrets.BOT_TOKEN}}
result-encoding: string
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.checkAuthorized({github, context});
# These steps only run if the check was successful
Expand Down Expand Up @@ -540,7 +540,7 @@ jobs:
with:
github-token: ${{secrets.BOT_TOKEN}}
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.addCompatFlag({github, context});
- name: Commit changes
Expand Down Expand Up @@ -584,7 +584,7 @@ jobs:
with:
github-token: ${{secrets.BOT_TOKEN}}
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.addCompatFlagCreatePR({github, context});
Expand Down Expand Up @@ -613,7 +613,7 @@ jobs:
github-token: ${{secrets.BOT_TOKEN}}
result-encoding: string
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.checkAuthorized({github, context});
# These steps only run if the check was successful
Expand Down Expand Up @@ -656,7 +656,7 @@ jobs:
with:
github-token: ${{secrets.BOT_TOKEN}}
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.addFingerprint({github, context});
- name: Commit changes
Expand Down Expand Up @@ -702,5 +702,5 @@ jobs:
with:
github-token: ${{secrets.BOT_TOKEN}}
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.addFingerprintCreatePR({github, context});
2 changes: 1 addition & 1 deletion .github/workflows/zwave-js-bot_discussion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
with:
github-token: ${{secrets.BOT_TOKEN}}
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.ensureLogfileInDiscussion({github, context});
2 changes: 1 addition & 1 deletion .github/workflows/zwave-js-bot_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
with:
github-token: ${{secrets.BOT_TOKEN}}
script: |
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.js`);
const bot = require(`${process.env.GITHUB_WORKSPACE}/.github/bot-scripts/index.cjs`);
return bot.ensureLogfile({github, context});

0 comments on commit 828b0b6

Please sign in to comment.