From fbbcdfc6ff605a68ad0f34a9b8f1d0c3501e9922 Mon Sep 17 00:00:00 2001 From: Kevin Deng Date: Thu, 21 May 2026 02:57:33 +0900 Subject: [PATCH] refactor: rename project to actionspack --- PLAN.md | 64 +++++++++---------- README.md | 46 ++++++------- __snapshots__/tsnapi/cli.snapshot.d.ts | 2 +- __snapshots__/tsnapi/cli.snapshot.js | 2 +- __snapshots__/tsnapi/index.snapshot.d.ts | 38 +++++------ __snapshots__/tsnapi/index.snapshot.js | 2 +- ...ack.schema.json => actionspack.schema.json | 8 +-- package.json | 10 +-- src/cli.ts | 6 +- src/commands.ts | 8 +-- src/index.ts | 4 +- src/pack.ts | 8 +-- src/types.ts | 10 +-- src/utils/fs.ts | 24 +++---- src/utils/github.ts | 4 +- src/utils/substitute.ts | 5 +- tests/index.test.ts | 8 +-- 17 files changed, 127 insertions(+), 122 deletions(-) rename flowpack.schema.json => actionspack.schema.json (82%) diff --git a/PLAN.md b/PLAN.md index 3a2936d..c7a9fb1 100644 --- a/PLAN.md +++ b/PLAN.md @@ -1,6 +1,6 @@ # PLAN.md — GitHub Actions Workflow Packer -Working name: **`flowpack`** +Working name: **`actionspack`** ## 1. Vision @@ -64,19 +64,19 @@ The lockfile records every entry workflow and its complete transitive dependency The default command should be: ```bash -flowpack pack +actionspack pack ``` Running the binary with no subcommand should behave the same way: ```bash -flowpack +actionspack ``` Equivalent to: ```bash -flowpack pack +actionspack pack ``` `install` should not be used as the main command name. The tool is not primarily installing packages; it is scanning, locking, inlining, and generating workflow artifacts. @@ -94,13 +94,13 @@ But once the lockfile resolves `main` to a commit SHA, `pack` should continue us A dependency should only move to a newer commit when the user explicitly runs: ```bash -flowpack update +actionspack update ``` or: ```bash -flowpack update actions/checkout +actionspack update actions/checkout ``` This gives the package-manager behavior: @@ -156,14 +156,14 @@ Example: ```text .github/workflows/ci.src.yml # authored by humans -.github/workflows/ci.yml # generated by flowpack +.github/workflows/ci.yml # generated by actionspack workflow.lock.yml # single lockfile for all entries ``` Optional config file: ```yaml -# flowpack.yml +# actionspack.yml entries: - source: .github/workflows/ci.src.yml output: .github/workflows/ci.yml @@ -184,7 +184,7 @@ If no config exists, the tool can discover: Main command. ```bash -flowpack pack +actionspack pack ``` Performs: @@ -209,7 +209,7 @@ This means `@main` in the source workflow does not automatically move forward ev ### 4.2 `scan` ```bash -flowpack scan +actionspack scan ``` Scans source workflows and updates the lockfile graph without generating packed workflows. @@ -230,7 +230,7 @@ Scans source workflows and updates the lockfile graph without generating packed ### 4.3 `update` ```bash -flowpack update +actionspack update ``` Updates all dependencies according to their requested refs. @@ -238,11 +238,11 @@ Updates all dependencies according to their requested refs. Examples: ```bash -flowpack update +actionspack update -flowpack update actions/checkout +actionspack update actions/checkout -flowpack update actions/setup-node --recursive +actionspack update actions/setup-node --recursive ``` `update` should: @@ -257,19 +257,19 @@ flowpack update actions/setup-node --recursive Recommended default: ```text -flowpack update = update lockfile, then pack +actionspack update = update lockfile, then pack ``` A flag can disable packing: ```bash -flowpack update --lockfile-only +actionspack update --lockfile-only ``` ### 4.4 `tree` ```bash -flowpack tree +actionspack tree ``` Shows dependency chains from the lockfile. @@ -287,19 +287,19 @@ Example output: Useful options: ```bash -flowpack tree --entry .github/workflows/ci.src.yml +actionspack tree --entry .github/workflows/ci.src.yml -flowpack tree --json +actionspack tree --json -flowpack tree --show-sha +actionspack tree --show-sha -flowpack tree --show-risk +actionspack tree --show-risk ``` ### 4.5 `why` ```bash -flowpack why actions/cache +actionspack why actions/cache ``` Shows why a dependency exists. @@ -319,7 +319,7 @@ This should be based entirely on `workflow.lock.yml`, not on the packed workflow ### 4.6 `diff` ```bash -flowpack diff +actionspack diff ``` Shows changes between the current lockfile and a previous lockfile state. @@ -345,7 +345,7 @@ This command is important for reviewing supply-chain updates in pull requests. ### 4.7 `audit` ```bash -flowpack audit +actionspack audit ``` Checks the lockfile and source workflows for security risks. @@ -366,7 +366,7 @@ Potential checks: ### 4.8 `verify` ```bash -flowpack verify +actionspack verify ``` Verifies that: @@ -606,7 +606,7 @@ jobs: ### 9.2 Pack ```bash -flowpack pack +actionspack pack ``` This generates or updates: @@ -619,7 +619,7 @@ workflow.lock.yml ### 9.3 Inspect dependency tree ```bash -flowpack tree +actionspack tree ``` Example: @@ -635,7 +635,7 @@ Example: ### 9.4 Explain a dependency ```bash -flowpack why actions/cache +actionspack why actions/cache ``` Example: @@ -651,7 +651,7 @@ actions/cache is used by: ### 9.5 Update dependencies ```bash -flowpack update +actionspack update ``` This explicitly moves locked commits forward. @@ -659,7 +659,7 @@ This explicitly moves locked commits forward. Then review: ```bash -flowpack diff +actionspack diff ``` Finally commit: @@ -743,14 +743,14 @@ Recommended behavior: - existing locked dependencies stay locked - new dependencies are resolved and added - removed dependencies are pruned or marked unused -- updates require flowpack update +- updates require actionspack update ``` This matches package-manager ergonomics while keeping versions stable. ## 13. Summary -`flowpack` is a GitHub Actions dependency manager and packer. +`actionspack` is a GitHub Actions dependency manager and packer. It should: diff --git a/README.md b/README.md index 210433f..5f00697 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# flowpack +# actionspack [![Open on npmx][npmx-version-src]][npmx-href] [![npm downloads][npmx-downloads-src]][npmx-href] [![Unit Test][unit-test-src]][unit-test-href] -`flowpack` is a lockfile-first GitHub Actions workflow packer. It lets you +`actionspack` is a lockfile-first GitHub Actions workflow packer. It lets you author workflows in `.github/workflows/src/`, lock every remote workflow/action dependency in `.github/workflow.lock.yml`, and generate pinned workflows in `.github/workflows/`. @@ -16,7 +16,7 @@ dependencies instead of being bundled. ## Install ```bash -npm i flowpack +npm i actionspack ``` ## Usage @@ -38,35 +38,35 @@ jobs: Then run: ```bash -npx flowpack +npx actionspack ``` -`flowpack` defaults to `flowpack pack`. It writes: +`actionspack` defaults to `actionspack pack`. It writes: - `.github/workflow.lock.yml` - `.github/workflows/ci.yml` Generated workflows are safe to commit. Existing lockfile SHAs are reused until -you explicitly run `flowpack update`. +you explicitly run `actionspack update`. ## Commands ```bash -flowpack pack +actionspack pack ``` Scan source workflows, resolve missing dependencies, update the lockfile, and write generated workflows. ```bash -flowpack scan +actionspack scan ``` Update the lockfile graph shape only. This adds newly discovered dependencies and removes unreachable ones without refreshing existing SHAs. ```bash -flowpack update [package] +actionspack update [package] ``` Refresh all locked dependencies, or only the selected package. By default this @@ -74,17 +74,17 @@ also packs workflows. Use `--lockfile-only` to update only `.github/workflow.lock.yml`. ```bash -flowpack verify +actionspack verify ``` Check that generated workflows are current and contain no unsupported unpinned remote references. ```bash -flowpack tree -flowpack why -flowpack diff -flowpack diff --json +actionspack tree +actionspack why +actionspack diff +actionspack diff --json ``` Inspect the lockfile dependency tree, explain why a package is present, or @@ -92,14 +92,14 @@ compare the current lockfile with `HEAD`. ## Configuration -`flowpack.yml` is optional. Without it, `flowpack` discovers +`actionspack.yml` is optional. Without it, `actionspack` discovers `.github/workflows/src/*.yml` and `.github/workflows/src/*.yaml`, then writes matching generated workflows to `.github/workflows/*.yml`. Use explicit entries when you need custom paths: ```yaml -$schema: ./flowpack.schema.json +$schema: ./actionspack.schema.json entries: - source: .github/workflows/src/ci.yml @@ -117,7 +117,7 @@ external: The same configuration can be supplied through CLI flags: ```bash -flowpack pack \ +actionspack pack \ --entry .github/workflows/src/ci.yml:.github/workflows/ci.yml \ --external actions/checkout ``` @@ -138,7 +138,7 @@ yet. They are pinned to locked SHAs as external dependencies. ## API ```ts -import { diff, pack, scan, tree, update, verify, why } from 'flowpack' +import { diff, pack, scan, tree, update, verify, why } from 'actionspack' await pack() await update({ packageName: 'owner/repo', lockfileOnly: true }) @@ -159,8 +159,8 @@ await verify() -[npmx-version-src]: https://npmx.dev/api/registry/badge/version/flowpack -[npmx-downloads-src]: https://npmx.dev/api/registry/badge/downloads-month/flowpack -[npmx-href]: https://npmx.dev/flowpack -[unit-test-src]: https://github.com/sxzz/flowpack/actions/workflows/unit-test.yml/badge.svg -[unit-test-href]: https://github.com/sxzz/flowpack/actions/workflows/unit-test.yml +[npmx-version-src]: https://npmx.dev/api/registry/badge/version/actionspack +[npmx-downloads-src]: https://npmx.dev/api/registry/badge/downloads-month/actionspack +[npmx-href]: https://npmx.dev/actionspack +[unit-test-src]: https://github.com/sxzz/actionspack/actions/workflows/unit-test.yml/badge.svg +[unit-test-href]: https://github.com/sxzz/actionspack/actions/workflows/unit-test.yml diff --git a/__snapshots__/tsnapi/cli.snapshot.d.ts b/__snapshots__/tsnapi/cli.snapshot.d.ts index 9a824fd..f567147 100644 --- a/__snapshots__/tsnapi/cli.snapshot.d.ts +++ b/__snapshots__/tsnapi/cli.snapshot.d.ts @@ -1,4 +1,4 @@ /** - * Generated by tsnapi — public API snapshot of `flowpack/cli` + * Generated by tsnapi — public API snapshot of `actionspack/cli` */ /* no exports */ \ No newline at end of file diff --git a/__snapshots__/tsnapi/cli.snapshot.js b/__snapshots__/tsnapi/cli.snapshot.js index 9a824fd..f567147 100644 --- a/__snapshots__/tsnapi/cli.snapshot.js +++ b/__snapshots__/tsnapi/cli.snapshot.js @@ -1,4 +1,4 @@ /** - * Generated by tsnapi — public API snapshot of `flowpack/cli` + * Generated by tsnapi — public API snapshot of `actionspack/cli` */ /* no exports */ \ No newline at end of file diff --git a/__snapshots__/tsnapi/index.snapshot.d.ts b/__snapshots__/tsnapi/index.snapshot.d.ts index faa1e73..174d110 100644 --- a/__snapshots__/tsnapi/index.snapshot.d.ts +++ b/__snapshots__/tsnapi/index.snapshot.d.ts @@ -1,12 +1,24 @@ /** - * Generated by tsnapi — public API snapshot of `flowpack` + * Generated by tsnapi — public API snapshot of `actionspack` */ // #region Interfaces +export interface ActionspackConfig { + entries: WorkflowEntry[]; + external: string[]; +} +export interface ActionspackOptions { + cwd?: string; + entries?: WorkflowEntry[]; + external?: string[]; + github?: GitHubClient; + stdout?: WritableStream; + stderr?: WritableStream; +} export interface CommandResult { lockfile: Lockfile; entries: WorkflowEntry[]; } -export interface DiffOptions extends FlowpackOptions { +export interface DiffOptions extends ActionspackOptions { json?: boolean; } export interface DiffResult { @@ -19,18 +31,6 @@ export interface DiffResult { dependencyChanged: boolean; }>; } -export interface FlowpackConfig { - entries: WorkflowEntry[]; - external: string[]; -} -export interface FlowpackOptions { - cwd?: string; - entries?: WorkflowEntry[]; - external?: string[]; - github?: GitHubClient; - stdout?: WritableStream; - stderr?: WritableStream; -} export interface GitHubClient { resolveRef: (_: string, _: string, _: string) => Promise; readFile: (_: string, _: string, _: string, _: string) => Promise; @@ -62,7 +62,7 @@ export interface LockPackage { contentDigest: string; dependencies: LockDependency[]; } -export interface UpdateOptions extends FlowpackOptions { +export interface UpdateOptions extends ActionspackOptions { packageName?: string; lockfileOnly?: boolean; } @@ -78,11 +78,11 @@ export declare function collectStepDependencies(_: unknown[], _: string): Resolv export declare function collectWorkflowDependencies(_: Record, _: string): ResolvedDependency[]; export declare function diff(_?: DiffOptions): Promise; export declare function diffLockfiles(_: Lockfile, _: Lockfile): DiffResult; -export declare function pack(_?: FlowpackOptions): Promise; +export declare function pack(_?: ActionspackOptions): Promise; export declare function packWorkflow(_: Record, _: Lockfile, _: GitHubClient): Promise>; export declare function scan(_?: ScanOptions): Promise; -export declare function tree(_?: FlowpackOptions): Promise; +export declare function tree(_?: ActionspackOptions): Promise; export declare function update(_?: UpdateOptions): Promise; -export declare function verify(_?: FlowpackOptions): Promise; -export declare function why(_: string, _?: FlowpackOptions): Promise; +export declare function verify(_?: ActionspackOptions): Promise; +export declare function why(_: string, _?: ActionspackOptions): Promise; // #endregion \ No newline at end of file diff --git a/__snapshots__/tsnapi/index.snapshot.js b/__snapshots__/tsnapi/index.snapshot.js index 30d8965..3845b66 100644 --- a/__snapshots__/tsnapi/index.snapshot.js +++ b/__snapshots__/tsnapi/index.snapshot.js @@ -1,5 +1,5 @@ /** - * Generated by tsnapi — public API snapshot of `flowpack` + * Generated by tsnapi — public API snapshot of `actionspack` */ // #region Functions export function assertNoRemoteUses(_, _) {} diff --git a/flowpack.schema.json b/actionspack.schema.json similarity index 82% rename from flowpack.schema.json rename to actionspack.schema.json index 557ff5a..219ccb5 100644 --- a/flowpack.schema.json +++ b/actionspack.schema.json @@ -1,8 +1,8 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://raw.githubusercontent.com/sxzz/flowpack/main/flowpack.schema.json", - "title": "flowpack configuration", - "description": "Configuration for flowpack.yml.", + "$id": "https://raw.githubusercontent.com/sxzz/actionspack/main/actionspack.schema.json", + "title": "actionspack configuration", + "description": "Configuration for actionspack.yml.", "type": "object", "additionalProperties": false, "properties": { @@ -11,7 +11,7 @@ "type": "string" }, "entries": { - "description": "Explicit source workflow to generated workflow mappings. When omitted, flowpack discovers .github/workflows/src/*.yml and .github/workflows/src/*.yaml.", + "description": "Explicit source workflow to generated workflow mappings. When omitted, actionspack discovers .github/workflows/src/*.yml and .github/workflows/src/*.yaml.", "type": "array", "items": { "type": "object", diff --git a/package.json b/package.json index eeba3da..4fd9d99 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "flowpack", + "name": "actionspack", "type": "module", "version": "0.0.0", "packageManager": "pnpm@11.1.3", @@ -7,13 +7,13 @@ "author": "Kevin Deng ", "license": "MIT", "funding": "https://github.com/sponsors/sxzz", - "homepage": "https://github.com/sxzz/flowpack#readme", + "homepage": "https://github.com/sxzz/actionspack#readme", "repository": { "type": "git", - "url": "git+https://github.com/sxzz/flowpack.git" + "url": "git+https://github.com/sxzz/actionspack.git" }, "bugs": { - "url": "https://github.com/sxzz/flowpack/issues" + "url": "https://github.com/sxzz/actionspack/issues" }, "exports": { ".": "./dist/index.mjs", @@ -21,7 +21,7 @@ "./package.json": "./package.json" }, "bin": { - "flowpack": "./dist/cli.mjs" + "actionspack": "./dist/cli.mjs" }, "files": [ "dist" diff --git a/src/cli.ts b/src/cli.ts index 1171d19..9e07b1d 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -4,7 +4,7 @@ import { styleText } from 'node:util' import { cac } from 'cac' import pkg from '../package.json' with { type: 'json' } import { diff, pack, scan, tree, update, verify, why } from './commands.ts' -import type { FlowpackOptions, WorkflowEntry } from './types.ts' +import type { ActionspackOptions, WorkflowEntry } from './types.ts' const cli = cac(pkg.name) @@ -130,7 +130,7 @@ async function main(): Promise { function normalizeConfigFlags( flags: ConfigFlags, -): Pick { +): Pick { return { ...(flags.entry ? { entries: normalizeEntries(flags.entry) } : {}), ...(flags.external @@ -156,6 +156,6 @@ function normalizeStringList(value: string | string[]): string[] { main().catch((error: unknown) => { const message = error instanceof Error ? error.message : String(error) - process.stderr.write(`${styleText('red', `flowpack: ${message}`)}\n`) + process.stderr.write(`${styleText('red', `actionspack: ${message}`)}\n`) process.exitCode = 1 }) diff --git a/src/commands.ts b/src/commands.ts index 217f056..b899249 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -11,9 +11,9 @@ import { import { matchesPackageSelector } from './utils/ref.ts' import { stringifyYaml } from './utils/yaml.ts' import type { + ActionspackOptions, DiffOptions, DiffResult, - FlowpackOptions, LockDependency, Lockfile, UpdateOptions, @@ -33,7 +33,7 @@ export async function update(options: UpdateOptions = {}): Promise { } } -export async function tree(options: FlowpackOptions = {}): Promise { +export async function tree(options: ActionspackOptions = {}): Promise { const lockfile = await readLockfile(options.cwd) const lines: string[] = [] for (const [source, entry] of Object.entries(lockfile.entries)) { @@ -47,7 +47,7 @@ export async function tree(options: FlowpackOptions = {}): Promise { export async function why( packageName: string, - options: FlowpackOptions = {}, + options: ActionspackOptions = {}, ): Promise { const lockfile = await readLockfile(options.cwd) const matches = new Set( @@ -91,7 +91,7 @@ export async function diff( } export async function verifyEntryConfig( - options: FlowpackOptions = {}, + options: ActionspackOptions = {}, ): Promise { const config = await discoverConfig(options.cwd) if (config.entries.length === 0) { diff --git a/src/index.ts b/src/index.ts index 9351d15..2e2ddaa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,11 +11,11 @@ export { export { assertNoRemoteUses, packWorkflow } from './pack.ts' export { collectStepDependencies, collectWorkflowDependencies } from './scan.ts' export type { + ActionspackConfig, + ActionspackOptions, CommandResult, DiffOptions, DiffResult, - FlowpackConfig, - FlowpackOptions, GitHubClient, LockDependency, LockEntry, diff --git a/src/pack.ts b/src/pack.ts index 053ef4e..aed44e8 100644 --- a/src/pack.ts +++ b/src/pack.ts @@ -20,8 +20,8 @@ import { normalizeInputValue, substituteValue } from './utils/substitute.ts' import { parseActionMap, parseWorkflowMap } from './utils/workflow-parser.ts' import { asArray, asRecord, stringifyWorkflowYaml } from './utils/yaml.ts' import type { + ActionspackOptions, CommandResult, - FlowpackOptions, GitHubClient, Lockfile, LockPackage, @@ -29,7 +29,7 @@ import type { } from './types.ts' export async function pack( - options: FlowpackOptions = {}, + options: ActionspackOptions = {}, ): Promise { const cwd = resolveCwd(options.cwd) const config = await discoverConfig(cwd, options) @@ -43,7 +43,7 @@ export async function pack( export async function packScanned( scanResult: CommandResult, - options: FlowpackOptions = {}, + options: ActionspackOptions = {}, ): Promise { const cwd = resolveCwd(options.cwd) const github = options.github ?? new HttpGitHubClient() @@ -62,7 +62,7 @@ export async function packScanned( } export async function verify( - options: FlowpackOptions = {}, + options: ActionspackOptions = {}, ): Promise { const cwd = resolveCwd(options.cwd) const config = await discoverConfig(cwd, options) diff --git a/src/types.ts b/src/types.ts index 245528e..3cebdef 100644 --- a/src/types.ts +++ b/src/types.ts @@ -2,7 +2,7 @@ import type { GitHubClient } from './utils/github.ts' export type { GitHubClient } -export interface FlowpackOptions { +export interface ActionspackOptions { cwd?: string entries?: WorkflowEntry[] external?: string[] @@ -20,7 +20,7 @@ export interface WorkflowEntry { output: string } -export interface FlowpackConfig { +export interface ActionspackConfig { entries: WorkflowEntry[] external: string[] } @@ -69,16 +69,16 @@ export interface RemoteRef { kind: 'action' | 'reusable-workflow' } -export interface ScanOptions extends FlowpackOptions { +export interface ScanOptions extends ActionspackOptions { refreshPackages?: Set } -export interface UpdateOptions extends FlowpackOptions { +export interface UpdateOptions extends ActionspackOptions { packageName?: string lockfileOnly?: boolean } -export interface DiffOptions extends FlowpackOptions { +export interface DiffOptions extends ActionspackOptions { json?: boolean } diff --git a/src/utils/fs.ts b/src/utils/fs.ts index e0a8cbb..8ea9b62 100644 --- a/src/utils/fs.ts +++ b/src/utils/fs.ts @@ -4,8 +4,8 @@ import process from 'node:process' import { parseWorkflowMap } from './workflow-parser.ts' import { parseYamlMap, stringifyWorkflowYaml, stringifyYaml } from './yaml.ts' import type { - FlowpackConfig, - FlowpackOptions, + ActionspackConfig, + ActionspackOptions, Lockfile, WorkflowEntry, } from '../types.ts' @@ -49,23 +49,25 @@ export async function writeYamlFile( export async function discoverConfig( cwd?: string, - overrides: Pick = {}, -): Promise { + overrides: Pick = {}, +): Promise { const root = resolveCwd(cwd) - const configPath = path.join(root, 'flowpack.yml') - let config: FlowpackConfig + const configPath = path.join(root, 'actionspack.yml') + let config: ActionspackConfig if (await fileExists(configPath)) { const rawConfig = await readYamlFile(configPath) const entries = Array.isArray(rawConfig.entries) ? rawConfig.entries : [] config = { entries: entries.map((entry) => { if (!entry || typeof entry !== 'object' || Array.isArray(entry)) { - throw new TypeError('flowpack.yml entries must be mappings') + throw new TypeError('actionspack.yml entries must be mappings') } const source = Reflect.get(entry, 'source') const output = Reflect.get(entry, 'output') if (typeof source !== 'string' || typeof output !== 'string') { - throw new TypeError('flowpack.yml entries require source and output') + throw new TypeError( + 'actionspack.yml entries require source and output', + ) } return { source, output } }), @@ -81,7 +83,7 @@ export async function discoverConfig( } } -async function discoverDefaultConfig(root: string): Promise { +async function discoverDefaultConfig(root: string): Promise { const sourceDir = path.join(root, DEFAULT_SOURCE_DIR) if (!(await fileExists(sourceDir))) { return { entries: [], external: [] } @@ -104,8 +106,8 @@ async function discoverDefaultConfig(root: string): Promise { } function normalizeConfigOverrides( - overrides: Pick, -): Partial { + overrides: Pick, +): Partial { return { ...(overrides.entries ? { entries: overrides.entries } : {}), ...(overrides.external ? { external: overrides.external } : {}), diff --git a/src/utils/github.ts b/src/utils/github.ts index 44c7a95..5c8bc40 100644 --- a/src/utils/github.ts +++ b/src/utils/github.ts @@ -31,7 +31,7 @@ export class HttpGitHubClient implements GitHubClient { constructor( token: string | undefined = process.env.GITHUB_TOKEN, - cacheDir: string = path.join(tmpdir(), 'flowpack-github-cache'), + cacheDir: string = path.join(tmpdir(), 'actionspack-github-cache'), ) { this.#cacheDir = cacheDir this.#token = token @@ -105,7 +105,7 @@ export class HttpGitHubClient implements GitHubClient { ): Promise { const headers: Record = { accept: 'application/vnd.github+json', - 'user-agent': 'flowpack', + 'user-agent': 'actionspack', 'x-github-api-version': '2022-11-28', } if (this.#token) { diff --git a/src/utils/substitute.ts b/src/utils/substitute.ts index 91b14f4..7a6d51d 100644 --- a/src/utils/substitute.ts +++ b/src/utils/substitute.ts @@ -80,7 +80,10 @@ function parseCompositeRunExpression(value: string): string | undefined { steps: - run: ${JSON.stringify(value)} ` - const result = parseActionTemplate(content, 'flowpack-substitute/action.yml') + const result = parseActionTemplate( + content, + 'actionspack-substitute/action.yml', + ) if (!result.value) { return undefined } diff --git a/tests/index.test.ts b/tests/index.test.ts index 2f53326..2a16fe8 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -53,7 +53,7 @@ class TestOutput { } } -describe('flowpack', () => { +describe('actionspack', () => { it('simplifies static format calls inside expressions', () => { expect( substituteString( @@ -412,7 +412,7 @@ jobs: it('keeps configured external actions pinned instead of bundling them', async () => { const cwd = await fixtureRepo({ - 'flowpack.yml': ` + 'actionspack.yml': ` external: - acme/root entries: @@ -468,7 +468,7 @@ jobs: }) it('caches GitHub file reads by sha and path in a temporary directory', async () => { - const cacheDir = await mkdtemp(path.join(tmpdir(), 'flowpack-cache-')) + const cacheDir = await mkdtemp(path.join(tmpdir(), 'actionspack-cache-')) const originalFetch = globalThis.fetch let calls = 0 globalThis.fetch = (() => { @@ -560,7 +560,7 @@ packages: }) async function fixtureRepo(files: Record): Promise { - const cwd = await mkdtemp(path.join(tmpdir(), 'flowpack-')) + const cwd = await mkdtemp(path.join(tmpdir(), 'actionspack-')) for (const [file, content] of Object.entries(files)) { const target = path.join(cwd, file) await import('node:fs/promises').then(({ mkdir }) => -- 2.51.2