Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/blob-creator.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as github from '@actions/github';
import type { FileChange } from './types';
import type { FileChange } from './types.js';
type Octokit = ReturnType<typeof github.getOctokit>;
/**
* Tree item for GitHub API
Expand Down
2 changes: 1 addition & 1 deletion dist/commit-creator.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionInputs, CommitResult } from './types';
import type { ActionInputs, CommitResult } from './types.js';
/**
* Create a signed commit using the GitHub API
* @param inputs The action inputs
Expand Down
2 changes: 1 addition & 1 deletion dist/file-collector.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FileChange } from './types';
import type { FileChange } from './types.js';
/**
* Collect files based on the input
* @param paths Optional list of paths to collect (supports wildcards)
Expand Down
4 changes: 2 additions & 2 deletions dist/github-client.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RepositoryInfo } from './types';
import type { RepositoryInfo } from './types.js';
/**
* Parse repository string into owner and repo
* @param repository Repository in format owner/repo
Expand All @@ -11,6 +11,6 @@ export declare function parseRepository(repository: string): RepositoryInfo;
* @param token GitHub token for authentication
* @returns Octokit instance
*/
export declare function createGitHubClient(token: string): import("@octokit/core").Octokit & import("@octokit/plugin-rest-endpoint-methods/dist-types/types").Api & {
export declare function createGitHubClient(token: string): import("@octokit/core").Octokit & import("@octokit/plugin-rest-endpoint-methods").Api & {
paginate: import("@octokit/plugin-paginate-rest").PaginateInterface;
};
11 changes: 8 additions & 3 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/input-parser.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionInputs } from './types';
import type { ActionInputs } from './types.js';
/**
* Get and validate all action inputs
* @returns An object containing all the inputs for the action
Expand Down
3 changes: 3 additions & 0 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
2 changes: 1 addition & 1 deletion dist/validation.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionInputs } from './types';
import type { ActionInputs } from './types.js';
/**
* Validate action inputs for security and correctness
* @param inputs The action inputs to validate
Expand Down
1,059 changes: 703 additions & 356 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "gha-create-signed-commit",
"description": "Create a signed commit using the GitHub API without pushing it",
"type": "module",
"main": "dist/index.js",
"scripts": {
"test": "node --test --require ts-node/register **/*.test.ts",
"test": "node --test --import tsx **/*.test.ts",
"prebuild": "mkdir -p dist",
"build": "ncc build src/index.ts -o dist --minify",
"lint": "biome check",
Expand All @@ -14,15 +15,16 @@
"author": "Statens Pensjonskasse",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.1"
"@actions/core": "^3.0.0",
"@actions/exec": "^3.0.0",
"@actions/github": "^9.1.0"
},
"devDependencies": {
"@statens-pensjonskasse/biome": "^2.0.22",
"@types/node": "^24.10.4",
"@statens-pensjonskasse/biome": "^2.0.23",
"@types/node": "^24.12.2",
"@vercel/ncc": "^0.38.4",
"ts-node": "^10.9.2",
"esmock": "^2.7.3",
"tsx": "^4.21.0",
"typescript": "^5.9.3"
}
}
22 changes: 15 additions & 7 deletions src/blob-creator.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import * as assert from 'node:assert';
import { describe, it, mock } from 'node:test';
import * as core from '@actions/core';
import { createBlobsInBatches } from './blob-creator';
import type { FileChange } from './types';

// Suppress logging in tests
mock.method(core, 'info', () => {});
mock.method(core, 'debug', () => {});
import esmock from 'esmock';
import type { FileChange } from './types.js';

// Import createBlobsInBatches with @actions/core mocked to suppress logging
const { createBlobsInBatches } = await esmock(
'./blob-creator.js',
import.meta.url,
{},
{
'@actions/core': {
info: () => {},
debug: () => {},
},
},
);

describe('createBlobsInBatches', () => {
it('should create blobs for all files', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/blob-creator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from '@actions/core';
import type * as github from '@actions/github';
import type { FileChange } from './types';
import type { FileChange } from './types.js';

type Octokit = ReturnType<typeof github.getOctokit>;

Expand Down
Loading