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
5,668 changes: 5,400 additions & 268 deletions dist/index.js

Large diffs are not rendered by default.

427 changes: 427 additions & 0 deletions dist/licenses.txt

Large diffs are not rendered by default.

181 changes: 181 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"license": "MIT",
"dependencies": {
"@actions/core": "^3.0.0",
"@actions/github": "^9.0.0",
"@actions/glob": "^0.6.1",
"axios": "^1.6.7",
"form-data": "^4.0.0"
Expand Down
69 changes: 69 additions & 0 deletions src/__mocks__/@actions/github.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Manual mock for @actions/github

// Default mock context values - can be overridden in tests
let mockContext = {
payload: {} as Record<string, unknown>,
eventName: 'push',
sha: '',
ref: '',
workflow: '',
action: '',
actor: '',
job: '',
runAttempt: 1,
runNumber: 0,
runId: 0,
apiUrl: 'https://api.github.com',
serverUrl: 'https://github.com',
graphqlUrl: 'https://api.github.com/graphql',
repo: {
owner: '',
repo: '',
},
issue: {
owner: '',
repo: '',
number: 0,
},
};

export const context = mockContext;

// Helper to reset context to defaults
export function resetContext(): void {
mockContext = {
payload: {},
eventName: 'push',
sha: '',
ref: '',
workflow: '',
action: '',
actor: '',
job: '',
runAttempt: 1,
runNumber: 0,
runId: 0,
apiUrl: 'https://api.github.com',
serverUrl: 'https://github.com',
graphqlUrl: 'https://api.github.com/graphql',
repo: {
owner: '',
repo: '',
},
issue: {
owner: '',
repo: '',
number: 0,
},
};
// Update the exported context reference
Object.assign(context, mockContext);
}

// Helper to set context values in tests
export function setContext(overrides: Partial<typeof mockContext>): void {
Object.assign(context, overrides);
}

// Mock getOctokit function
export const getOctokit = jest.fn();
Loading