-
Notifications
You must be signed in to change notification settings - Fork 5
Upgrade to @actions/cache@6, @actions/core@3 and migrate to ESM for Node.js 24 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,51 +1,46 @@ | ||||||||||||||||||||||||||||||||
| const core = require("@actions/core"); | ||||||||||||||||||||||||||||||||
| const { execSync } = require("child_process"); | ||||||||||||||||||||||||||||||||
| const cache = require("@actions/cache"); | ||||||||||||||||||||||||||||||||
| const { parseBooleanInput, buildBaseConfig } = require("./utils"); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| async function fetchCache() { | ||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||
| const cleanUpCache = parseBooleanInput(core.getInput("clean")); | ||||||||||||||||||||||||||||||||
| if (cleanUpCache) return; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| import * as core from "@actions/core"; | ||||||||||||||||||||||||||||||||
| import { execSync } from "node:child_process"; | ||||||||||||||||||||||||||||||||
| import * as cache from "@actions/cache"; | ||||||||||||||||||||||||||||||||
| import { buildBaseConfig } from "./utils.js"; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||
| const cleanUpCache = core.getBooleanInput("clean"); | ||||||||||||||||||||||||||||||||
| if (!cleanUpCache) { | ||||||||||||||||||||||||||||||||
| const { keyString: baseKey, paths, cacheToolchain, cacheCcache } = buildBaseConfig(); | ||||||||||||||||||||||||||||||||
| const skipBuildingToolchain = parseBooleanInput(core.getInput("skip"), true); | ||||||||||||||||||||||||||||||||
| const skipBuildingToolchain = core.getBooleanInput("skip"); | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
| const skipBuildingToolchain = core.getBooleanInput("skip"); | |
| const skipInput = core.getInput("skip"); | |
| let skipBuildingToolchain: boolean; | |
| if (skipInput === "") { | |
| // Preserve previous semantics: default to true when input is unset | |
| skipBuildingToolchain = true; | |
| } else if (/^(true|1)$/i.test(skipInput)) { | |
| skipBuildingToolchain = true; | |
| } else if (/^(false|0)$/i.test(skipInput)) { | |
| skipBuildingToolchain = false; | |
| } else { | |
| throw new Error( | |
| "Invalid value for 'skip'. Expected one of: 'true', 'false', '1', '0', or empty (defaults to true)." | |
| ); | |
| } |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
execSyncis still imported but the timestamp logic was switched toDate.now(), soexecSyncis no longer used in this file. Remove thenode:child_processimport to avoid dead code and keep the module dependency surface minimal.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
execSyncimport is still needed — it's used on lines 35-36 for thesedcommands that skip toolchain building. The reviewer's suggestion was incorrect; removing the import would break the action whencacheToolchain && skipBuildingToolchainis true.